aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqml.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-06-14 13:39:49 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-06-14 21:20:16 +0200
commit3d4ceaf5b83d74d0c2f87caa45547237b3e315fb (patch)
treed0b30ed201ed56b3317dd581f1ea7f468dc13aa2 /src/qml/qml/qqml.cpp
parentc83249da39ed1ec33bfb35cd630f6b3c0facf7a3 (diff)
Fix AOT-lookup of values in value types
We cannot use the lookup metatype before we initialize it, and the calling code cannot know the result metatype before the lookup is initialized, either. Pick-to: 6.2 Change-Id: I3c691b41dbdb416aa1822c0ea7c4b887398f7908 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/qml/qqml.cpp')
-rw-r--r--src/qml/qml/qqml.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp
index 9d4c752e4f..2144893c2d 100644
--- a/src/qml/qml/qqml.cpp
+++ b/src/qml/qml/qqml.cpp
@@ -853,8 +853,8 @@ static bool initValueLookup(QV4::Lookup *l, QV4::ExecutableCompilationUnit *comp
Q_ASSERT(metaObject);
const QByteArray name = compilationUnit->runtimeStrings[l->nameIndex]->toQString().toUtf8();
const int coreIndex = metaObject->indexOfProperty(name.constData());
- QMetaType lookupType = metaObject->property(l->qgadgetLookup.coreIndex).metaType();
- if (lookupType != type)
+ QMetaType lookupType = metaObject->property(coreIndex).metaType();
+ if (type.isValid() && lookupType != type)
return false;
l->qgadgetLookup.metaObject = quintptr(metaObject) + 1;
l->qgadgetLookup.coreIndex = coreIndex;