aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-02 01:00:20 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-02 01:00:20 +0100
commitbd5804e0c79cd01e8c503dc336f6e178cc205a1f (patch)
tree2b9e4f29f359b4c48d7b97be18f43afe3b1a260a /src/qml/compiler/qv4codegen.cpp
parentad8e47f5181fd8240645282abbc671812a9f4fa8 (diff)
parentf82c8ed1ef7b0f1150efe481a247260c382179c0 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 7aa848f6e9..a0a2a17b0f 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -3341,7 +3341,6 @@ bool Codegen::visit(ForEachStatement *ast)
BytecodeGenerator::Label in = bytecodeGenerator->newLabel();
BytecodeGenerator::Label end = bytecodeGenerator->newLabel();
- BytecodeGenerator::Label done = bytecodeGenerator->newLabel();
{
auto cleanup = [ast, iterator, iteratorDone, this]() {
@@ -3360,7 +3359,7 @@ bool Codegen::visit(ForEachStatement *ast)
next.value = lhsValue.stackSlot();
next.done = iteratorDone.stackSlot();
bytecodeGenerator->addInstruction(next);
- bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpTrue()).link(done);
+ bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpTrue()).link(end);
// each iteration gets it's own context, as per spec
{
@@ -3401,11 +3400,10 @@ bool Codegen::visit(ForEachStatement *ast)
error:
end.link();
- // ~ControlFlowLoop will be called here, which will generate unwind code when needed
+ // all execution paths need to end up here (normal loop exit, break, and exceptions) in
+ // order to reset the unwind handler, and to close the iterator in calse of an for-of loop.
}
- done.link();
-
return false;
}
@@ -3664,15 +3662,12 @@ void Codegen::handleTryCatch(TryStatement *ast)
{
Q_ASSERT(ast);
RegisterScope scope(this);
- BytecodeGenerator::Label noException = bytecodeGenerator->newLabel();
{
ControlFlowCatch catchFlow(this, ast->catchExpression);
RegisterScope scope(this);
TailCallBlocker blockTailCalls(this); // IMPORTANT: destruction will unblock tail calls before catch is generated
statement(ast->statement);
- bytecodeGenerator->jump().link(noException);
}
- noException.link();
}
void Codegen::handleTryFinally(TryStatement *ast)