From 353c38e23108856daa2c5d0e86443ac5136dcaa7 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 15:02:29 +0000 Subject: fix(codegen): skip IR verification after reported errors Verify the module only when no error was reported, and let defineRecord skip bad fields and still set the record body, marking it Invalid so later missing-field lookups stay silent. Co-Authored-By: Claude Sonnet 5.5 --- lib/CodeGen/Designator.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/Designator.cc') diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc index 4f0e82b..6737937 100644 --- a/lib/CodeGen/Designator.cc +++ b/lib/CodeGen/Designator.cc @@ -219,7 +219,9 @@ bool CodeGen::emitLValue(ExprAST *E, LValueInfo &Out) { } const RecordFieldInfo *FI = RP->findField(A.FieldName); if (!FI) { - reportError("Record type %s has no field %s", TypeName.c_str(), A.FieldName.c_str()); + // The rejected field was already reported with its record. + if (!RP->Invalid) + reportError("Record type %s has no field %s", TypeName.c_str(), A.FieldName.c_str()); return false; } if (!FI->IsPublic && !sameIdentifier(CurrentClass, TypeName)) { -- cgit v1.3.1-4-g156e