diff options
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index c3b6ab0b77..75212b841c 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -1207,7 +1207,6 @@ bool Codegen::visit(ArrayPattern *ast) BytecodeGenerator::Label in = bytecodeGenerator->newLabel(); BytecodeGenerator::Label end = bytecodeGenerator->newLabel(); - BytecodeGenerator::Label done = bytecodeGenerator->newLabel(); { auto cleanup = [this, iterator, iteratorDone]() { @@ -1217,26 +1216,21 @@ bool Codegen::visit(ArrayPattern *ast) bytecodeGenerator->addInstruction(close); }; ControlFlowLoop flow(this, &end, &in, cleanup); - bytecodeGenerator->jump().link(in); - - BytecodeGenerator::Label body = bytecodeGenerator->label(); - - lhsValue.loadInAccumulator(); - pushAccumulator(); - in.link(); + bytecodeGenerator->addLoopStart(in); iterator.loadInAccumulator(); Instruction::IteratorNext next; next.value = lhsValue.stackSlot(); next.done = iteratorDone.stackSlot(); bytecodeGenerator->addInstruction(next); - bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpFalse()).link(body); - bytecodeGenerator->jump().link(done); + bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpTrue()).link(end); + lhsValue.loadInAccumulator(); + pushAccumulator(); + + bytecodeGenerator->jump().link(in); end.link(); } - - done.link(); } else { RegisterScope innerScope(this); Reference expr = expression(it->element->initializer); |