diff options
| author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-02 01:00:20 +0100 |
|---|---|---|
| committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-02 01:00:20 +0100 |
| commit | bd5804e0c79cd01e8c503dc336f6e178cc205a1f (patch) | |
| tree | 2b9e4f29f359b4c48d7b97be18f43afe3b1a260a /src/qml/compiler/qv4codegen.cpp | |
| parent | ad8e47f5181fd8240645282abbc671812a9f4fa8 (diff) | |
| parent | f82c8ed1ef7b0f1150efe481a247260c382179c0 (diff) | |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ibe849c0c91bbc190b5e3a39b6cba64f9e297b89f
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
| -rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 11 |
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) |
