diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-11-15 16:34:27 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-11-22 12:32:23 +0100 |
| commit | df01095a66558494dbee03c2e352390c843f27de (patch) | |
| tree | 6f25b5da96ba5243063f7b46f3c5dce9898bfa32 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 8f827de1a1cc466f4c99049a90669f1c538e717f (diff) | |
QmlCompiler: Don't crash on CallWithSpread
When preparing for such a call, the byte code loads an "empty" constant.
This has to be represented in the type system so that we don't hit the
assert at the end of the instruction.
Pick-to: 6.4 6.2
Task-number: QTBUG-108441
Change-Id: I66220bfae3d3a4b8e9600d84d4cfc43ac858b77e
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 85490f3ab3..dd8338e8fd 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -144,6 +144,7 @@ private slots: void listAsArgument(); void letAndConst(); void signalIndexMismatch(); + void callWithSpread(); }; void tst_QmlCppCodegen::initTestCase() @@ -2791,6 +2792,16 @@ void tst_QmlCppCodegen::signalIndexMismatch() QCOMPARE(visualIndexBeforeMoveList, QList<QVariant>({ 0, 1, 2 })); QCOMPARE(visualIndexAfterMoveList, QList<QVariant>({ 0, 1, 2 })); +} + +void tst_QmlCppCodegen::callWithSpread() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/callWithSpread.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QTest::ignoreMessage(QtCriticalMsg, "That is great!"); + QScopedPointer<QObject> o(c.create()); + QVERIFY(!o.isNull()); }; QTEST_MAIN(tst_QmlCppCodegen) |
