summaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine/tst_qjsengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qjsengine/tst_qjsengine.cpp')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index c3a3926144..bb923951a8 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -201,6 +201,7 @@ private slots:
void basicBlockMergeAfterLoopPeeling();
+ void modulusCrash();
void malformedExpression();
void scriptScopes();
@@ -4137,6 +4138,15 @@ void tst_QJSEngine::basicBlockMergeAfterLoopPeeling()
}
+void tst_QJSEngine::modulusCrash()
+{
+ QJSEngine engine;
+ QJSValue result = engine.evaluate(
+ "var a = -2147483648; var b = -1; var c = a % b; c;"
+ );
+ QVERIFY(result.isNumber() && result.toNumber() == 0.);
+}
+
void tst_QJSEngine::malformedExpression()
{
QJSEngine engine;