qmllint: Read the right register when analyzing calls
CallProperty does not use the accumulator. Pick-to: 6.4 6.4.2 Fixes: QTBUG-109144 Change-Id: I2bd98bb3a66d68806d250bd50226a8f8e0cdf765 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit is contained in:
parent
4677b2bdd6
commit
303bfe42e8
|
@ -1094,8 +1094,9 @@ void QQmlJSTypePropagator::generate_CallProperty(int nameIndex, int base, int ar
|
||||||
|
|
||||||
if (m_passManager != nullptr) {
|
if (m_passManager != nullptr) {
|
||||||
// TODO: Should there be an analyzeCall() in the future? (w. corresponding onCall in Pass)
|
// TODO: Should there be an analyzeCall() in the future? (w. corresponding onCall in Pass)
|
||||||
m_passManager->analyzeRead(m_typeResolver->containedType(m_state.accumulatorIn()),
|
m_passManager->analyzeRead(
|
||||||
propertyName, m_function->qmlScope, getCurrentSourceLocation());
|
m_typeResolver->containedType(callBase),
|
||||||
|
propertyName, m_function->qmlScope, getCurrentSourceLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
addReadRegister(base, callBase);
|
addReadRegister(base, callBase);
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
import QtQml
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
function whatSUp() : string { return "I'm crashing"; }
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
import QtQml
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
function bar(foo : Foo) {
|
||||||
|
var state = foo.whatSUp()
|
||||||
|
}
|
||||||
|
}
|
|
@ -1189,6 +1189,7 @@ void TestQmllint::cleanQmlCode_data()
|
||||||
QTest::newRow("optionalChainingCall") << QStringLiteral("optionalChainingCall.qml");
|
QTest::newRow("optionalChainingCall") << QStringLiteral("optionalChainingCall.qml");
|
||||||
QTest::newRow("EnumAccessCpp") << QStringLiteral("EnumAccessCpp.qml");
|
QTest::newRow("EnumAccessCpp") << QStringLiteral("EnumAccessCpp.qml");
|
||||||
QTest::newRow("qtquickdialog") << QStringLiteral("qtquickdialog.qml");
|
QTest::newRow("qtquickdialog") << QStringLiteral("qtquickdialog.qml");
|
||||||
|
QTest::newRow("callBase") << QStringLiteral("callBase.qml");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestQmllint::cleanQmlCode()
|
void TestQmllint::cleanQmlCode()
|
||||||
|
|
Loading…
Reference in New Issue