summaryrefslogtreecommitdiff
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.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 2418e0e7de..bf05c5c538 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -530,6 +530,10 @@ Codegen::Reference Codegen::targetForPatternElement(AST::PatternElement *p)
Reference lhs = expression(p->bindingTarget);
if (hasError)
return lhs;
+ if (!lhs.isLValue()) {
+ throwReferenceError(p->bindingTarget->firstSourceLocation(), QStringLiteral("Binding target is not a reference."));
+ return lhs;
+ }
lhs = lhs.asLValue();
return lhs;
}