diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-05-18 15:42:03 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-05-18 18:44:40 +0200 |
commit | 8651d913649aa21424794a4367d146f9a1ec930f (patch) | |
tree | 9e47d1c5f180ac9f781d665f8696fd22753d25a5 | |
parent | 53c7211a24f0c5f06d2ed18de10e04bd68fc3d72 (diff) |
Resolve chicken/egg problem when initializing AOT lookups
As long as the lookup isn't initialized, we cannot get its result type.
If the AOT code relies on the result type to be retrieved from the
lookup, allow an invalid type to be passed to the initialization
function.
Change-Id: I36a1dbe316010dc466a28bae65c3ed267588fc29
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/qml/qml/qqml.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index fd20b43acf..e0e9d9ea8a 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -786,7 +786,11 @@ static bool initObjectLookup( return false; const QMetaType propType = property->propType(); - if ((type.flags() & QMetaType::IsQmlList) && (propType.flags() & QMetaType::IsQmlList)) { + if (!type.isValid()) { + // If type is invalid, then the calling code depends on the lookup + // to be set up in order to query the type, via lookupResultMetaType. + // We cannot verify the type in this case. + } else if ((type.flags() & QMetaType::IsQmlList) && (propType.flags() & QMetaType::IsQmlList)) { // We want to check the value types here, but we cannot easily do it. // Internally those are all QObject* lists, though. } else if (type.flags() & QMetaType::PointerToQObject) { @@ -809,7 +813,7 @@ static bool initObjectLookup( if (!foundMetaObject) return false; - } else if (property->propType() != type) { + } else if (propType != type) { return false; } |