aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-06-20 12:16:53 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-06-20 10:18:31 +0000
commitc9989e48989ce243fa1e87423d104efac98876d4 (patch)
tree036a9a3cd63fefb731a4b995b054af43b26292cb /src/qml/compiler
parent7dd3d7d9259d1c77bc020fabc02a21f414baee7f (diff)
Fix assertion in LocalForeachStatement
Change-Id: I7386769ed62de8a5e86e08c23671f8e9e5a5be3c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qv4codegen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index d4a9537757..bd38058142 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2766,7 +2766,7 @@ bool Codegen::visit(LocalForEachStatement *ast)
BytecodeGenerator::Label body = bytecodeGenerator->label();
- Reference it = Reference::fromName(this, ast->declaration->name.toString());
+ Reference it = referenceForName(ast->declaration->name.toString(), true);
statement(ast->statement);
in.link();
@@ -2776,6 +2776,8 @@ bool Codegen::visit(LocalForEachStatement *ast)
nextPropInstr.arg = obj.asRValue();
bytecodeGenerator->addInstruction(nextPropInstr);
+ it.writeBack();
+
Reference null = Reference::fromConst(this, QV4::Encode::null());
bytecodeGenerator->jumpStrictNotEqual(it.asRValue(), null.asRValue()).link(body);