aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4vme_moth.cpp
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2022-07-29 16:12:24 +0200
committerUlf Hermann <[email protected]>2022-08-03 08:19:54 +0200
commitd8db6e9484884f9d93ef584e63e695ae0322fc8f (patch)
treeba6a525b1cdd0aca8dcbb449d7a3e87042dd5554 /src/qml/jsruntime/qv4vme_moth.cpp
parentb44c06dbc726d81481a0c6e28060ed3b3c9d4ecf (diff)
V4: Fix exponentiation operator
We need to use the same algorithm as for Math.pow(...). Since we have jsExponentiate() now, we can use it in all those places. The strange AIX special case is definitely not useful anymore. Task-number: QTBUG-105188 Change-Id: I43a251c71f1b547ad36855ac197080bfea8c94e3 Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index b69efc40d9..8eb1503e28 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -1372,10 +1372,7 @@ QV4::ReturnedValue VME::interpret(JSTypesStackFrame *frame, ExecutionEngine *eng
const Value left = STACK_VALUE(lhs);
double base = left.toNumber();
double exp = ACC.toNumber();
- if (qIsInf(exp) && (base == 1 || base == -1))
- acc = Encode(qQNaN());
- else
- acc = Encode(pow(base,exp));
+ acc = Encode(QQmlPrivate::jsExponentiate(base, exp));
MOTH_END_INSTR(Exp)
MOTH_BEGIN_INSTR(Mul)