aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-09 01:01:06 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-09 01:01:07 +0200
commit8c3172d724f3ad03cdee7bae23443fa109d350b1 (patch)
tree53ad546936e22b99d1ea395a875a312332d05516 /src/qml/jsruntime/qv4runtime.cpp
parent5a5441f38e0529d852536b776cd9f26dad410e62 (diff)
parent4b6832828e04a9806aaf345da5f456817dd3970b (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta2
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 3e9e972d77..f7c339dc26 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1990,6 +1990,7 @@ ReturnedValue Runtime::method_div(const Value &left, const Value &right)
int lval = left.integerValue();
int rval = right.integerValue();
if (rval != 0 // division by zero should result in a NaN
+ && !(lval == std::numeric_limits<int>::min() && rval == -1) // doesn't fit in int
&& (lval % rval == 0) // fractions can't be stored in an int
&& !(lval == 0 && rval < 0)) // 0 / -something results in -0.0
return Encode(int(lval / rval));