aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-12-17 10:55:03 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-12-19 08:38:35 +0000
commit0baea2a53986b119f1ab260eb0ec478d72d3a8ef (patch)
treea89ea41a4465875f0475069b7ebe1f2e7e8a0aff /src/qmlcompiler
parentbd73a1ab6544bcef848e485b573e2c2b10458ea5 (diff)
Do not return a null scope from storedType()
We can store everything in a QJSValue. Returning an invalid scope triggers inadequate code paths later on. Change-Id: I700d7a3219e5784d3ec125806f70018417ceac14 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f6294b7938c221974cdf3a39d7d71addf5b08f6b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qmlcompiler')
-rw-r--r--src/qmlcompiler/qqmljstyperesolver.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljstyperesolver.cpp b/src/qmlcompiler/qqmljstyperesolver.cpp
index 6cfe756ab8..9c5264e68d 100644
--- a/src/qmlcompiler/qqmljstyperesolver.cpp
+++ b/src/qmlcompiler/qqmljstyperesolver.cpp
@@ -942,8 +942,13 @@ QQmlJSScope::ConstPtr QQmlJSTypeResolver::storedType(const QQmlJSScope::ConstPtr
return jsPrimitiveType();
if (type->isScript())
return jsValueType();
- if (type->isComposite())
- return QQmlJSScope::nonCompositeBaseType(type);
+ if (type->isComposite()) {
+ if (const QQmlJSScope::ConstPtr nonComposite = QQmlJSScope::nonCompositeBaseType(type))
+ return nonComposite;
+
+ // If we can't find the non-composite base, we really don't know what it is.
+ return genericType(type);
+ }
if (type->fileName().isEmpty())
return genericType(type);
return type;