From c3c988e186d2c3bc2480191ed5c62acd128b5f7b Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 11 Oct 2018 13:31:28 +0200 Subject: JS: Check if the rhs of an assignment had errors before using it Change-Id: I34d70759732433b6f0ecccc5ae175d33ec8e1577 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4codegen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/qml') 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(); -- cgit v1.2.3