diff options
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qml/qmlmin/tst_qmlmin.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/fuzzed.2.qml | bin | 0 -> 404 bytes | |||
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 4 |
5 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index a79d4d074c..5a1364473e 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -867,7 +867,7 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt *typeRecursionDetected = true; } else { QQmlType returnType = fetchOrCreateTypeForUrl( - qmlUrl, type, registrationType == QQmlType::CompositeSingletonType, nullptr); + qmlUrl, type, registrationType == QQmlType::CompositeSingletonType, errors); if (type_return) *type_return = returnType; return returnType.isValid(); diff --git a/tests/auto/qml/qmlmin/tst_qmlmin.cpp b/tests/auto/qml/qmlmin/tst_qmlmin.cpp index c393149f59..d1e74aecef 100644 --- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp +++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp @@ -128,6 +128,7 @@ void tst_qmlmin::initTestCase() invalidFiles << "tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001.js"; invalidFiles << "tests/auto/qml/qjsengine/script/com/trolltech/syntaxerror/__init__.js"; invalidFiles << "tests/auto/qml/debugger/qqmlpreview/data/broken.qml"; + invalidFiles << "tests/auto/qml/qqmllanguage/data/fuzzed.2.qml"; } QStringList tst_qmlmin::findFiles(const QDir &d) diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt b/tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt new file mode 100644 index 0000000000..92ce4c649f --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt @@ -0,0 +1,2 @@ +5:1:TetZ$ is not a type +-1:-1:Invalid QML type name "TetZ$" diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.2.qml b/tests/auto/qml/qqmllanguage/data/fuzzed.2.qml Binary files differnew file mode 100644 index 0000000000..e726f6783c --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/fuzzed.2.qml 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<QObject> object; |