diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-06-14 13:39:49 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-06-14 21:20:16 +0200 |
commit | 3d4ceaf5b83d74d0c2f87caa45547237b3e315fb (patch) | |
tree | d0b30ed201ed56b3317dd581f1ea7f468dc13aa2 /src/qml/qml/qqml.cpp | |
parent | c83249da39ed1ec33bfb35cd630f6b3c0facf7a3 (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.cpp | 4 |
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; |