aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Designator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/Designator.cc')
-rw-r--r--lib/CodeGen/Designator.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc
index 6c00524..afaf0a4 100644
--- a/lib/CodeGen/Designator.cc
+++ b/lib/CodeGen/Designator.cc
@@ -54,6 +54,7 @@ bool CodeGen::emitLValue(ExprAST *E, LValueInfo &Out) {
}
return false;
}
+ if (!requireWritable(*Info, Var->getName())) return false;
if (Info->IsArray) {
reportError("Whole array %s is not an assignable location; index it", Var->getName().c_str());
return false;
@@ -84,6 +85,7 @@ bool CodeGen::emitLValue(ExprAST *E, LValueInfo &Out) {
return false;
}
+ if (!requireWritable(*Info, D->getBaseName())) return false;
const auto &Accesses = D->getAccesses();
Value *Addr = Info->Storage;
std::string TypeName = Info->TypeName;