diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-02-13 17:21:15 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-09-21 19:22:33 +0100 |
commit | 3f9d19b17b5ab6f9943a50d52da3b63932fb5014 (patch) | |
tree | 436aa8dafdd6b763e893557e1d0aabc2c24fe13f /src | |
parent | dbab92688319fdb33f5177adb2572fc954ddebe0 (diff) |
QVariant: write less haphazardly to data
While the data subobject is at the same position in memory as the
QVariant::Private, using d.data actually activates the union member.
Change-Id: Ie6879b588c8e830ae8b34cfcd8e9ddff8b60b3a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index c2c39efea3..547839d248 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -533,9 +533,9 @@ QVariant::QVariant(const QVariant &p) auto other = p.constData(); if (iface) { if (other) - iface->copyCtr(iface, &d, other); + iface->copyCtr(iface, &d.data, other); else - iface->defaultCtr(iface, &d); + iface->defaultCtr(iface, &d.data); } } |