aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljslintercodegen.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2024-07-01 12:39:53 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2024-07-02 13:51:34 +0200
commite14c148261a4511e1c1a4f3b934ec97b782e832c (patch)
tree73dce0a5cb946ffa60c0bd5fe5b9974feacf31a0 /src/qmlcompiler/qqmljslintercodegen.cpp
parent6dd4fc5ce321ed8275fe544f21c562dd257b841a (diff)
qmllint: avoid stale typeresolver pointer
It's not accessible via public API, but it risks wrecking havoc on internal plugins, and would also likely cause issues if we were to expose the global JS object to QQmlSA plugins. The current fix is rather a minimal workaround, we should revisit whether codegen should really take ownership of the typeResolver. Pick-to: 6.8 Change-Id: I6ca6e78527ce886155cfc0a21038348da2982c03 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljslintercodegen.cpp')
-rw-r--r--src/qmlcompiler/qqmljslintercodegen.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljslintercodegen.cpp b/src/qmlcompiler/qqmljslintercodegen.cpp
index 60fc9cb5ad..314c2087e4 100644
--- a/src/qmlcompiler/qqmljslintercodegen.cpp
+++ b/src/qmlcompiler/qqmljslintercodegen.cpp
@@ -79,6 +79,13 @@ QQmlJSLinterCodegen::compileFunction(const QV4::Compiler::Context *context,
return QQmlJSAotFunction {};
}
+void QQmlJSLinterCodegen::setPassManager(QQmlSA::PassManager *passManager)
+{
+ m_passManager = passManager;
+ auto managerPriv = QQmlSA::PassManagerPrivate::get(passManager);
+ managerPriv->m_typeResolver = typeResolver();
+}
+
bool QQmlJSLinterCodegen::analyzeFunction(const QV4::Compiler::Context *context,
QQmlJSCompilePass::Function *function,
QQmlJS::DiagnosticMessage *error)