diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-25 13:02:22 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-25 14:08:22 +0100 |
commit | 6e8f6f446ac8854fd23cb3cbf0fc1f3646299ca6 (patch) | |
tree | 4cd0e2b7257887bff427b778d9d543cafd2267d9 /src/qmlcompiler/qqmljscodegenerator.cpp | |
parent | 23ab2e0f5552bb54fef5a6c57f5f82f430d0956c (diff) |
QmlCompiler: Don't generate code for untyped JS calls
This is inefficient.
Pick-to: 6.3
Task-number: QTBUG-101285
Change-Id: Iec7f02b4b95cb788c710a3634c2344843b125030
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscodegenerator.cpp')
-rw-r--r-- | src/qmlcompiler/qqmljscodegenerator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljscodegenerator.cpp b/src/qmlcompiler/qqmljscodegenerator.cpp index b08af00f1c..3847d52ed9 100644 --- a/src/qmlcompiler/qqmljscodegenerator.cpp +++ b/src/qmlcompiler/qqmljscodegenerator.cpp @@ -1426,6 +1426,9 @@ void QQmlJSCodeGenerator::generate_CallPropertyLookup(int index, int base, int a { INJECT_TRACE_INFO(generate_CallPropertyLookup); + if (m_state.accumulatorOut().variant() == QQmlJSRegisterContent::JavaScriptReturnValue) + reject(u"call to untyped JavaScript function"_qs); + const QQmlJSRegisterContent baseType = registerType(base); if (baseType.storedType()->accessSemantics() != QQmlJSScope::AccessSemantics::Reference) { const QString name = m_jsUnitGenerator->stringForIndex( @@ -1493,6 +1496,9 @@ void QQmlJSCodeGenerator::generate_CallQmlContextPropertyLookup(int index, int a { INJECT_TRACE_INFO(generate_CallQmlContextPropertyLookup); + if (m_state.accumulatorOut().variant() == QQmlJSRegisterContent::JavaScriptReturnValue) + reject(u"call to untyped JavaScript function"_qs); + m_body.setHasSideEffects(true); const QString indexString = QString::number(index); |