diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-06-14 13:39:49 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-14 20:39:07 +0000 |
commit | ab1be81cb26e1cb934cd30572517d7b0c5445d21 (patch) | |
tree | 5fa87700ae6467c609054983750cd77891429e4e /src | |
parent | 01b991ec1ea68b67589c2f93acf1f7704c516dd5 (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.
Change-Id: I3c691b41dbdb416aa1822c0ea7c4b887398f7908
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 3d4ceaf5b83d74d0c2f87caa45547237b3e315fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqml.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index fefbb66860..66991ad994 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; |