From bc00353cffbfe0f74b602a16452f2e7bcd588152 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 8 Apr 2019 16:57:30 +0200 Subject: Detect and reject cyclic aliases Previously those would result in infinite recursion. Fixes: QTBUG-74867 Change-Id: I6c0043b43e72fe7bc3a2a139ca600af2d5bca5ad Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp') diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index dea7c6c7ee..f7198415a2 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -612,6 +612,7 @@ void tst_qqmllanguage::errors_data() QTest::newRow("badCompositeRegistration.1") << "badCompositeRegistration.1.qml" << "badCompositeRegistration.1.errors.txt" << false; QTest::newRow("badCompositeRegistration.2") << "badCompositeRegistration.2.qml" << "badCompositeRegistration.2.errors.txt" << false; + QTest::newRow("cyclicAlias") << "cyclicAlias.qml" << "cyclicAlias.errors.txt" << false; } -- cgit v1.2.3 From 5fcc9906d7b6d19ea3d79ccf0d6446d01b583973 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 12 Oct 2018 10:47:51 +0200 Subject: QML: Check for (valid) compilation units while hashing When an error occurred while creating a compilation unit, the pointer might be set to null. Subsequent use in hashing should check for this, and not use a nullptr. Change-Id: I62650917a740c9c1be29608285670153bed8703c Reviewed-by: Ulf Hermann --- tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp') diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index f7198415a2..10af8d70e8 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -613,6 +613,8 @@ void tst_qqmllanguage::errors_data() QTest::newRow("badCompositeRegistration.1") << "badCompositeRegistration.1.qml" << "badCompositeRegistration.1.errors.txt" << false; QTest::newRow("badCompositeRegistration.2") << "badCompositeRegistration.2.qml" << "badCompositeRegistration.2.errors.txt" << false; QTest::newRow("cyclicAlias") << "cyclicAlias.qml" << "cyclicAlias.errors.txt" << false; + + QTest::newRow("fuzzed.1") << "fuzzed.1.qml" << "fuzzed.1.errors.txt" << false; } -- cgit v1.2.3 From 398d586a59e768f6e442fdc912d9180df71ff374 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 12 Oct 2018 12:13:45 +0200 Subject: QML: Allow fetchOrCreateTypeForUrl to report errors without qFatal Because qFatal will abort() the program. Task-number: QTBUG-71116 Change-Id: Ifd6be996cfbd6fff8e75ad2b26682c34f837ac88 Reviewed-by: Ulf Hermann --- tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp') diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 10af8d70e8..85dddbcb54 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -361,7 +361,7 @@ private: } \ file.close(); \ } else { \ - QCOMPARE(expected, actual); \ + QCOMPARE(actual, expected); \ } \ } @@ -615,6 +615,7 @@ void tst_qqmllanguage::errors_data() QTest::newRow("cyclicAlias") << "cyclicAlias.qml" << "cyclicAlias.errors.txt" << false; QTest::newRow("fuzzed.1") << "fuzzed.1.qml" << "fuzzed.1.errors.txt" << false; + QTest::newRow("fuzzed.2") << "fuzzed.2.qml" << "fuzzed.2.errors.txt" << false; } @@ -625,6 +626,7 @@ void tst_qqmllanguage::errors() QFETCH(bool, create); QQmlComponent component(&engine, testFileUrl(file)); + QTRY_VERIFY(!component.isLoading()); QScopedPointer object; -- cgit v1.2.3