aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2019-02-06 10:32:31 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2019-07-17 10:47:44 +0000
commitf3b1568d05d6c31137aae186d2928fef0faba9b1 (patch)
tree8cb99d0e792b5d2378be51a68151e9bb62527d94 /src
parent8f28229cec8ce8f52cefe760b86f3410786c201a (diff)
V4: Add label for loop in spread in ArrayPattern
This patch also rotates the loop back so that the condition is at the top of the loop. It's a cherry-picked from commit 0282b89ec672e25a465a8e51bc74c7fd58a624b1. Without explicitly setting the label, we get a default constructed Label from labelForOffset in PlatformAssemblerCommon::link, which leads to a jump into nirvana. This issue arises only with backward jumps, as we fill in the information for forward jump targets once we actually encounter the target. Fixes: QTBUG-77047 Change-Id: Id928831f90eace494adb1eb1190f674a6f033b20 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qv4codegen.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 61e37ffd25..5acc64bd81 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -1191,12 +1191,13 @@ bool Codegen::visit(ArrayPattern *ast)
ControlFlowLoop flow(this, &end, &in, cleanup);
in.link();
+ bytecodeGenerator->addLoopStart(in);
iterator.loadInAccumulator();
Instruction::IteratorNext next;
next.value = lhsValue.stackSlot();
next.done = iteratorDone.stackSlot();
bytecodeGenerator->addInstruction(next);
- bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpTrue()).link(end);
+ bytecodeGenerator->addJumpInstruction(Instruction::JumpTrue()).link(end);
lhsValue.loadInAccumulator();
pushAccumulator();