From: Lars Knoll Date: Thu, 24 Jan 2013 14:31:54 +0000 (+0100) Subject: Avoid integer division by 0 X-Git-Tag: upstream/5.2.1~669^2~659^2~388 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d059d3ab72c4483eb9754f0585f7d5892889b7d4;p=platform%2Fupstream%2Fqtdeclarative.git Avoid integer division by 0 Change-Id: I5c50878192e3f4dd6e7297e51a450840c4c1037e Reviewed-by: Simon Hausmann --- diff --git a/qmljs_runtime.h b/qmljs_runtime.h index 08ba85a..870e1d3 100644 --- a/qmljs_runtime.h +++ b/qmljs_runtime.h @@ -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);