diff options
author | Erik Verbruggen <erik.verbruggen@me.com> | 2013-11-11 14:23:50 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-12 14:40:22 +0100 |
commit | ff306b7829a6fcf1e1c28c3b0934ecebccd9e67d (patch) | |
tree | 807e230c1baa2865fb8e2bacdcff30b3c24c2a14 /src/qml/compiler/qv4codegen.cpp | |
parent | 24b9d7d1c215bf141bcff75e542ef0b00cd5dd3b (diff) |
V4: fix loop block marking for initializer blocks.
Any new blocks generated as part of the initializer were incorrectly
marked as belonging to a loop. For example, if a LocalForStatement
would contain a ternary expression, the generated then and else blocks
would be marked. This would confuse the block scheduling, because all
blocks are postponed unil the condition block (“group start”) is
scheduled.
Task-number: QTBUG-33754
Change-Id: I45919ebeac356f015bb91fe0210472b3df0b56d8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 640dad9c99..68c46f5677 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2291,11 +2291,11 @@ bool Codegen::visit(ForStatement *ast) V4IR::BasicBlock *forstep = _function->newBasicBlock(forcond, exceptionHandler()); V4IR::BasicBlock *forend = _function->newBasicBlock(groupStartBlock(), exceptionHandler()); - enterLoop(ast, forcond, forend, forstep); - statement(ast->initialiser); _block->JUMP(forcond); + enterLoop(ast, forcond, forend, forstep); + _block = forcond; if (ast->condition) condition(ast->condition, forbody, forend); @@ -2431,11 +2431,11 @@ bool Codegen::visit(LocalForStatement *ast) V4IR::BasicBlock *forstep = _function->newBasicBlock(forcond, exceptionHandler()); V4IR::BasicBlock *forend = _function->newBasicBlock(groupStartBlock(), exceptionHandler()); - enterLoop(ast, forcond, forend, forstep); - variableDeclarationList(ast->declarations); _block->JUMP(forcond); + enterLoop(ast, forcond, forend, forstep); + _block = forcond; if (ast->condition) condition(ast->condition, forbody, forend); |