diff options
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/crash2.qml | 5 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index b93a9b3..3253e72 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -2366,7 +2366,7 @@ bool QmlCompiler::buildBinding(QmlParser::Value *value, QmlParser::Property *prop, const BindingContext &ctxt) { - Q_ASSERT(prop->index); + Q_ASSERT(prop->index != -1); Q_ASSERT(prop->parent); Q_ASSERT(prop->parent->metaObject()); diff --git a/tests/auto/declarative/qmllanguage/data/crash2.qml b/tests/auto/declarative/qmllanguage/data/crash2.qml new file mode 100644 index 0000000..ae6f650 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/crash2.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +Object { + objectName: "Hello" + "World" +} diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index 128fa87..da586d9 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -123,6 +123,7 @@ private slots: // regression tests for crashes void crash1(); + void crash2(); private: QmlEngine engine; @@ -1152,6 +1153,11 @@ void tst_qmllanguage::crash1() QmlComponent component(&engine, "Component {}"); } +void tst_qmllanguage::crash2() +{ + QmlComponent component(&engine, TEST_FILE("crash2.qml")); +} + QTEST_MAIN(tst_qmllanguage) #include "tst_qmllanguage.moc" |