aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-06-22 11:33:42 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-06-22 09:53:34 +0000
commit8386e4d927b6fabf321f4e02de3da2bc1afc43b1 (patch)
treec7a7c39c8cbbcb6e8878bf7e9b784439e95c0d33 /src/qml/compiler/qv4codegen.cpp
parentabe3f614343da494248246f8c446a1ac0dab9e48 (diff)
Fix binops when rhs has an effect on the lhs
Like in "var x = 0; x * (x = 1)" Change-Id: I1e9087506f8b04ebbdbb7ad4fe7fbe935a949e42 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index b251938db0..6307ede749 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -1552,6 +1552,8 @@ bool Codegen::visit(BinaryExpression *ast)
//### TODO: try constant folding?
}
+ left.asRValue(); // force any loads of the lhs, so the rhs won't clobber it
+
Reference right = expression(ast->right);
if (hasError)
return false;