From e2c65706e61be09ddb7eeb28cd1957acd4317bcf Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 10:09:47 +0000 Subject: feat(constants): implement literal constants with lexical scope Co-Authored-By: Claude Fable 5.1 --- lib/CodeGen/Designator.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/CodeGen/Designator.cc') 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; -- cgit v1.3.1-4-g156e