diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-09 01:01:06 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-09 01:01:07 +0200 |
commit | 8c3172d724f3ad03cdee7bae23443fa109d350b1 (patch) | |
tree | 53ad546936e22b99d1ea395a875a312332d05516 /src/qml/jsruntime/qv4runtime.cpp | |
parent | 5a5441f38e0529d852536b776cd9f26dad410e62 (diff) | |
parent | 4b6832828e04a9806aaf345da5f456817dd3970b (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta2
Change-Id: I68211a7d4568a1c31c6a124fe6777709c53736a5
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 1 |
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)); |