aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index cab99b0c21..9bc9567be6 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2215,8 +2215,9 @@ bool Codegen::visit(NewExpression *ast)
Reference base = expression(ast->expression);
if (hasError)
return false;
- //### Maybe create a ConstructA that takes an accumulator?
+
base = base.storeOnStack();
+ base.loadInAccumulator();
Instruction::Construct create;
create.func = base.stackSlot();
@@ -2243,6 +2244,8 @@ bool Codegen::visit(NewMemberExpression *ast)
if (hasError)
return false;
+ base.loadInAccumulator();
+
if (calldata.hasSpread) {
Instruction::ConstructWithSpread create;
create.func = base.stackSlot();