aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-06-21 12:45:41 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-06-21 10:48:02 +0000
commit99df06a1e5fc0f57730a33c24c9ec4b7a6f511b8 (patch)
treee621a5090fd9be21e847087958a7f8e6eaeafea0 /src/qml/compiler/qv4codegen.cpp
parent46a7856a906875d66148d90e37ce6d343295cffa (diff)
Make sure we don't accept literals as lvalues
Change-Id: I06f475337944554842b4c0a05f0c88617579e2cb Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index d276a9d477..ee3c22737b 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2270,6 +2270,7 @@ bool Codegen::visit(RegExpLiteral *ast)
return false;
_expr.result = Reference::fromTemp(this);
+ _expr.result.isLiteral = true;
Instruction::LoadRegExp instr;
instr.result = _expr.result.asLValue();
@@ -2284,6 +2285,7 @@ bool Codegen::visit(StringLiteral *ast)
return false;
_expr.result = Reference::fromTemp(this);
+ _expr.result.isLiteral = true;
Instruction::LoadRuntimeString instr;
instr.result = _expr.result.asLValue();
@@ -3279,6 +3281,7 @@ Codegen::Reference &Codegen::Reference::operator =(const Reference &other)
needsWriteBack = false;
isArgOrEval = other.isArgOrEval;
codegen = other.codegen;
+ isLiteral = other.isLiteral;
return *this;
}