aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-03-14 10:51:32 +0100
committerLars Knoll <lars.knoll@qt.io>2018-04-25 17:50:29 +0000
commite2ed846dd4710268a208962f3217b79994e8cb31 (patch)
tree9f28dce3720ef6ef719d44ff20debbdb935f7b3a /src
parentd3058682fd3c9994c3a598d901398c1d751e2586 (diff)
Fix an assertion in the codegen
If there is no name for the binding, we need to store it's value as a temp on the stack for further destructuring. Change-Id: Ibf8651e5aed4f45f2ca5f2d2d3ddeb8fc60b5f9f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-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 6c57cdba9e..f7617c66de 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -400,7 +400,7 @@ void Codegen::variableDeclarationList(VariableDeclarationList *ast)
void Codegen::initializeAndDestructureBindingElement(AST::BindingElement *e, const Codegen::Reference &baseRef)
{
RegisterScope scope(this);
- Reference varToStore = referenceForName(e->name, true);
+ Reference varToStore = e->name.isNull() ? Reference::fromStackSlot(this, bytecodeGenerator->newRegister()) : referenceForName(e->name, true);
if (e->initializer && baseRef == varToStore) {
baseRef.loadInAccumulator();
BytecodeGenerator::Jump jump = bytecodeGenerator->jumpNotUndefined();