summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-04-13 22:50:23 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-02 14:18:54 +0000
commitc8901819a81ff8b4d612bc12f17b96e911675581 (patch)
tree70cf6f2759e3e2cda8d8d93835fcf967f25ce915 /src/qml/compiler/qv4codegen.cpp
parentd9c4a527241e0ef3a30e990c518197b0ba345b50 (diff)
downloadqtdeclarative-c8901819a81ff8b4d612bc12f17b96e911675581.tar.gz
Fix failing assertions when destructuring
Change-Id: I1ee33969486c1c522b18e54410265716f222f6eb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 61fe5587a5..d6b81372df 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -405,8 +405,10 @@ void Codegen::initializeAndDestructureBindingElement(AST::PatternElement *e, con
baseRef.loadInAccumulator();
BytecodeGenerator::Jump jump = bytecodeGenerator->jumpNotUndefined();
Reference expr = expression(e->initializer);
- if (hasError)
+ if (hasError) {
+ jump.link();
return;
+ }
expr.loadInAccumulator();
varToStore.storeConsumeAccumulator();
jump.link();
@@ -414,8 +416,10 @@ void Codegen::initializeAndDestructureBindingElement(AST::PatternElement *e, con
baseRef.loadInAccumulator();
BytecodeGenerator::Jump jump = bytecodeGenerator->jumpNotUndefined();
Reference expr = expression(e->initializer);
- if (hasError)
+ if (hasError) {
+ jump.link();
return;
+ }
expr.loadInAccumulator();
jump.link();
varToStore.storeConsumeAccumulator();