aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljscompiler.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-02-23 15:58:17 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-03-11 20:31:53 +0100
commitfc2cbdc660ba0fa71758cfc01808120d1cfe8b16 (patch)
treed8f3b07cc1431553b9d9c6ce462e7c19ad4a00d4 /src/qmlcompiler/qqmljscompiler.cpp
parent045b1d0cf4bb7bde54fe557076014f1930160e75 (diff)
QmlCompiler: Enforce sanity of type adjustments in basic blocks pass
If we cannot properly adjust the types, the result will probably be garbage and we should not try to generate any code. We are double checking the actually received type in the code generator, but if we get a different type at code generation time than we "ordered" at type propagation time, that's not great. The type propagator should already have checked that the types are convertible, after all. Change-Id: I9c20dbd6b4cc8214e780dad9eb4302ca6ef81bac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
-rw-r--r--src/qmlcompiler/qqmljscompiler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp
index 700bdb0d50..e946e622c0 100644
--- a/src/qmlcompiler/qqmljscompiler.cpp
+++ b/src/qmlcompiler/qqmljscompiler.cpp
@@ -780,7 +780,9 @@ QQmlJSAotFunction QQmlJSAotCompiler::doCompile(
return compileError();
QQmlJSBasicBlocks basicBlocks(m_unitGenerator, &m_typeResolver, m_logger);
- typePropagationResult = basicBlocks.run(function, typePropagationResult);
+ typePropagationResult = basicBlocks.run(function, typePropagationResult, error);
+ if (error->isValid())
+ return compileError();
QQmlJSShadowCheck shadowCheck(m_unitGenerator, &m_typeResolver, m_logger);
shadowCheck.run(&typePropagationResult, function, error);