aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2016-07-19 11:28:14 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2016-07-20 10:36:58 +0000
commit06ed1ad17abe1ef597d4ecf86962da5ac21365e5 (patch)
tree20df931fbed8904b4fdf25abaf7c94a5df30c6cc /tests
parent9d4b55640788bf96ea100ad0616fd4236370d140 (diff)
JS: Check for errors before using sub-expression results
Specifically: don't de-reference a result and assume that it's not-null. Task-number: QTBUG-54687 Change-Id: If07d3250a95a7815ab7a3262b88e0227965ef8e7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 2ec296ae66..aaa72d48cd 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -329,6 +329,7 @@ private slots:
void qtbug_46022();
void qtbug_52340();
void qtbug_54589();
+ void qtbug_54687();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -7932,6 +7933,12 @@ void tst_qqmlecmascript::qtbug_54589()
QCOMPARE(obj->property("result").toBool(), true);
}
+void tst_qqmlecmascript::qtbug_54687()
+{
+ QJSEngine e;
+ // it's simple: this shouldn't crash.
+ engine.evaluate("12\n----12");
+}
QTEST_MAIN(tst_qqmlecmascript)