diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-04-01 08:32:37 +0200 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-04-03 10:58:12 +0000 |
commit | bedf0367ac580a2e73712be2f4207bb6af9f0226 (patch) | |
tree | 8dfa471e3d7612ab5c2babe4e8ae1d9d6111f23c /src/corelib/kernel/qmetatype.h | |
parent | ad864ef194ddceed01c6fe16627f7ba761a972d0 (diff) |
QVariant: Fix flags for type-erased associative iterator key
The flags here are passed to a private QVariant constructor, and they
really represent a boolean - IsPointer or not.
Because the flag for the key_type was incorrectly populated with the
flag for the value_type, memory would be corrupted when using a mapping
type whose value_type is a pointer, but whose key type was not, such as
QMap<QString, int*>
This typo has been there since the concept was introduced in commit
v5.2.0-alpha1~807 (Add container access functionality for associative
containers in QVariant., 2013-04-05).
Task-number: QTBUG-52246
Change-Id: I9ecb13c603015eed2dc2ca43947fa0ecd6be8b5a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype.h')
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 3b8f8e7166..899a51173e 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -1226,7 +1226,7 @@ public: inline void destroyIter() { _destroyIter(&_iterator); } - inline VariantData getCurrentKey() const { return _getKey(&_iterator, _metaType_id_key, _metaType_flags_value); } + inline VariantData getCurrentKey() const { return _getKey(&_iterator, _metaType_id_key, _metaType_flags_key); } inline VariantData getCurrentValue() const { return _getValue(&_iterator, _metaType_id_value, _metaType_flags_value); } inline void find(const VariantData &key) |