From 3f9d19b17b5ab6f9943a50d52da3b63932fb5014 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Sat, 13 Feb 2021 17:21:15 +0100 Subject: [PATCH] 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 --- src/corelib/kernel/qvariant.cpp | 4 ++-- 1 file 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); } }