aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4vme_moth.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-01-22 14:15:24 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2018-01-26 19:44:51 +0000
commitf624e9c26f91def6b54f3a72f5bb36fa490b1aae (patch)
tree213519f07f26493aecb5f66023b7d9c572099ff3 /src/qml/jsruntime/qv4vme_moth.cpp
parentf5ee71993b3af8cf9cd89c605ab4bf30df30cb92 (diff)
Fix a couple of places where we'd free used objects
Make sure all our JS objects are referenced from the JS stack before calling into the memory manager. Change-Id: I88d622d37b9d6cfc19db4045ebd3fadc5bb4cabe 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.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 8355fbca71..e248d590f7 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -492,6 +492,7 @@ static bool compareEqualInt(Value &accumulator, Value lhs, int rhs)
if (val.isDouble()) \
d = val.doubleValue(); \
else { \
+ STORE_ACC(); \
d = val.toNumberImpl(); \
CHECK_EXCEPTION; \
} \
@@ -1290,9 +1291,9 @@ QV4::ReturnedValue VME::exec(const FunctionObject *fo, const Value *thisObject,
MOTH_END_INSTR(BitXor)
MOTH_BEGIN_INSTR(UShr)
- uint l = STACK_VALUE(lhs).toUInt32();
+ VALUE_TO_INT(l, STACK_VALUE(lhs));
VALUE_TO_INT(a, ACC);
- acc = Encode(l >> uint(a & 0x1f));
+ acc = Encode(static_cast<uint>(l) >> uint(a & 0x1f));
MOTH_END_INSTR(UShr)
MOTH_BEGIN_INSTR(Shr)