aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-30 13:20:43 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-30 15:57:19 +0000
commit2fdb6eba0a58b629db32f9eefec2f26df08d3d2e (patch)
tree5b953451a0202ceadcaf1a154ea43ee3b1c2c33d /src/qml/compiler
parent0d31aa1617c96ed3e3624d77332ea6f13aba1492 (diff)
Fix passing of locals as function arguments with side-effects
Commit 75c22465cf8fe262edfe6178bb9ca19661fb710e regressed in allowing locals and arguments to be passed directly as further arguments to function calls, but that's incorrect when considering var i = 2; testFunction(i, i += 2) where it is instrumental to place the first argument into a temp (making a copy) instead of passing it directly. Change-Id: Iffcf6c6eda92a8fb665982cda1db0b96359cd092 Task-number: QTBUG-45879 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qv4codegen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index a7b5326861..260db0f0dd 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -538,7 +538,7 @@ IR::Expr *Codegen::subscript(IR::Expr *base, IR::Expr *index)
IR::Expr *Codegen::argument(IR::Expr *expr)
{
- if (expr && !expr->asTemp() && !expr->asArgLocal()) {
+ if (expr && !expr->asTemp()) {
const unsigned t = _block->newTemp();
move(_block->TEMP(t), expr);
expr = _block->TEMP(t);