diff options
author | Liang Qi <liang.qi@qt.io> | 2019-02-01 14:31:31 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-02-01 14:50:06 +0100 |
commit | 4b0a030cc9b9fa32383a43e2b971f05a536b8e7f (patch) | |
tree | ac4738a7ae6ff491c3afa3171b27c9688635e58a /src/qml/compiler/qv4codegen.cpp | |
parent | e09519bad7ff266e466ea2d2d66187fbb13457f9 (diff) | |
parent | 5d8d0d7068bc8498ea2a6a4c9bc16e0eeb92836c (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
src/qml/compiler/qv4codegen.cpp
Done-With: Erik Verbruggen <erik.verbruggen@qt.io>
Change-Id: I3ae3d64317e4f3fccba6605f4c6da15479ca75e0
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) |