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 | |
parent | 3e351e6208b6b83a46909c9ac65eb8a5c878d707 (diff) |
Fix remaining test failures with the ** operator
Change-Id: I98da5b552747d6d0b363d83ecb4c408c66a2667b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/qml/jit/qv4baselinejit.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 5 | ||||
-rw-r--r-- | tests/auto/qml/ecmascripttests/TestExpectations | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/jit/qv4baselinejit.cpp b/src/qml/jit/qv4baselinejit.cpp index 764e75937e..cd07ac4d58 100644 --- a/src/qml/jit/qv4baselinejit.cpp +++ b/src/qml/jit/qv4baselinejit.cpp @@ -967,7 +967,9 @@ static ReturnedValue expHelper(const Value &base, const Value &exp) { double b = base.toNumber(); double e = exp.toNumber(); - return QV4::Encode(pow(b,e)); + if (qIsInf(e) && (b == 1 || b == -1)) + return Encode(qSNaN()); + return Encode(pow(b,e)); } void BaselineJIT::generate_Exp(int lhs) { 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) diff --git a/tests/auto/qml/ecmascripttests/TestExpectations b/tests/auto/qml/ecmascripttests/TestExpectations index b0a18339ce..45d05dcf0c 100644 --- a/tests/auto/qml/ecmascripttests/TestExpectations +++ b/tests/auto/qml/ecmascripttests/TestExpectations @@ -3561,8 +3561,6 @@ language/expressions/compound-assignment/S11.13.2_A7.9_T4.js fails language/expressions/conditional/tco-cond.js strictFails language/expressions/conditional/tco-pos.js strictFails language/expressions/delete/super-property.js fails -language/expressions/exponentiation/applying-the-exp-operator_A7.js fails -language/expressions/exponentiation/applying-the-exp-operator_A8.js fails language/expressions/function/arguments-with-arguments-fn.js sloppyFails language/expressions/function/arguments-with-arguments-lex.js sloppyFails language/expressions/function/dflt-params-ref-later.js fails |