diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-30 13:20:43 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-30 15:57:19 +0000 |
commit | 2fdb6eba0a58b629db32f9eefec2f26df08d3d2e (patch) | |
tree | 5b953451a0202ceadcaf1a154ea43ee3b1c2c33d /src/qml/compiler/qv4codegen.cpp | |
parent | 0d31aa1617c96ed3e3624d77332ea6f13aba1492 (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/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 2 |
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); |