aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-08-18 13:47:55 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-21 10:46:12 +0000
commit842ada7b04d68cd37df2556bf50b48d8a5f39ec4 (patch)
tree4f9265880d932e05f8191e395c85c3bc66578d36 /src/qml/compiler/qv4codegen.cpp
parent397db42518c93b81a3b24ecfd27ec4e63c6fc31d (diff)
Make sure the for-in loop variable is an lvalue
Change-Id: Ia040a5e0080e1619d5ec19a07138cf26e7a8086b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index f6ac4e7957..e3205d9d8d 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2152,7 +2152,7 @@ bool Codegen::visit(ForEachStatement *ast)
in.link();
- Reference lhs = expression(ast->initialiser);
+ Reference lhs = expression(ast->initialiser).asLValue();
obj.loadInAccumulator();
Instruction::ForeachNextPropertyName nextPropInstr;
@@ -2291,7 +2291,7 @@ bool Codegen::visit(LocalForEachStatement *ast)
BytecodeGenerator::Label body = bytecodeGenerator->label();
- Reference it = referenceForName(ast->declaration->name.toString(), true);
+ Reference it = referenceForName(ast->declaration->name.toString(), true).asLValue();
statement(ast->statement);
in.link();