Avoid integer division by 0
authorLars Knoll <lars.knoll@digia.com>
Thu, 24 Jan 2013 14:31:54 +0000 (15:31 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Thu, 24 Jan 2013 14:35:12 +0000 (15:35 +0100)
Change-Id: I5c50878192e3f4dd6e7297e51a450840c4c1037e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qmljs_runtime.h

index 08ba85a..870e1d3 100644 (file)
@@ -589,7 +589,7 @@ inline Value __qmljs_mod(Value left, Value right, ExecutionContext *ctx)
 {
     TRACE2(left, right);
 
-    if (Value::integerCompatible(left, right))
+    if (Value::integerCompatible(left, right) && right.integerValue() != 0)
         return Value::fromInt32(left.integerValue() % right.integerValue());
 
     double lval = __qmljs_to_number(left, ctx);