diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-03 22:03:02 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-06-04 13:02:25 +0000 |
commit | 9a0a074452c6534f25a878047398eea77a8c7e0e (patch) | |
tree | e429e3a85658b067c485ad1e089d5f0e01e18e30 /src/qml/jsruntime/qv4vme_moth.cpp | |
parent | 3e351e6208b6b83a46909c9ac65eb8a5c878d707 (diff) |
Fix remaining test failures with the ** operator
Change-Id: I98da5b552747d6d0b363d83ecb4c408c66a2667b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index f9a56eb877..052d6f773b 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -1340,7 +1340,10 @@ QV4::ReturnedValue VME::interpret(CppStackFrame &frame, const char *code) const Value left = STACK_VALUE(lhs); double base = left.toNumber(); double exp = ACC.toNumber(); - acc = QV4::Encode(pow(base,exp)); + if (qIsInf(exp) && (base == 1 || base == -1)) + acc = Encode(qSNaN()); + else + acc = Encode(pow(base,exp)); MOTH_END_INSTR(Exp) MOTH_BEGIN_INSTR(Mul) |