summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-24 13:10:33 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-24 13:43:41 +0100
commit3be3848338040f4178ed5a450d98eed883b79cb3 (patch)
tree1264b44438c11082b693df1a40446724c0b78d32 /src/gui
parentf0cc9f10da408a142eea685f9991ffd3cbcb1501 (diff)
Assert that either both or neither pointer are nullptr
Identical change to qmetatype.cpp Fixes static analyzer warning 0267bc9b3ba521cf8bf0a7fea8981ee5 Pick-to: 6.1 Change-Id: Id6219f5025d703dd43b1742a067aa934d6aacd8c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguivariant.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index c8200aedf1..1b455a57bf 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -117,6 +117,8 @@ static const struct : QMetaTypeModuleHelper
Q_ASSERT(fromTypeId != toTypeId);
bool onlyCheck = (from == nullptr && to == nullptr);
+ // either two nullptrs from canConvert, or two valid pointers
+ Q_ASSERT(onlyCheck || (bool(from) && bool(to)));
using Int = int;
switch (makePair(toTypeId, fromTypeId)) {