diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 21:10:11 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 20:52:40 +0000 |
commit | 2d6b08bd17377aa6bcb663029a196a8d19cac6ac (patch) | |
tree | 4bce8e27455c38b919a5a1706c6bb5b8b7f8813a /src/qml/compiler/qv4codegen.cpp | |
parent | bde97ab6a72acafaa29d2da0f7a31ae23918a6b0 (diff) | |
download | qtdeclarative-2d6b08bd17377aa6bcb663029a196a8d19cac6ac.tar.gz |
Give for loops a per-iteration context as well
Regular for loops also have a per iteration context for lexically
declared variables as well.
Change-Id: I35cb58bfb198c7dc32d70f41ea0ced7ddefcc37e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 9c63360107..49f0511116 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2708,6 +2708,10 @@ bool Codegen::visit(ForStatement *ast) setJumpOutLocation(bytecodeGenerator, ast->statement, ast->forToken); step.link(); + if (_context->requiresExecutionContext) { + Instruction::CloneBlockContext clone; + bytecodeGenerator->addInstruction(clone); + } statement(ast->expression); bytecodeGenerator->jump().link(cond); |