aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2018-10-11 13:31:28 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-10-15 12:48:37 +0000
commitc3c988e186d2c3bc2480191ed5c62acd128b5f7b (patch)
tree9807dffaf56a9977419464a9fa6a47cade1869c2 /src/qml/compiler
parent1a1e5789c754838473cbb81665667a4d3a42e33b (diff)
JS: Check if the rhs of an assignment had errors before using it
Change-Id: I34d70759732433b6f0ecccc5ae175d33ec8e1577 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler')
-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 8ff8ab7993..e55f4022d6 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -1318,7 +1318,10 @@ bool Codegen::visit(BinaryExpression *ast)
} else if (ast->op == QSOperator::Assign) {
if (AST::Pattern *p = ast->left->patternCast()) {
RegisterScope scope(this);
- Reference right = expression(ast->right).storeOnStack();
+ Reference right = expression(ast->right);
+ if (hasError)
+ return false;
+ right = right.storeOnStack();
destructurePattern(p, right);
if (!_expr.accept(nx)) {
right.loadInAccumulator();