diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 15:02:29 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 15:21:11 +0000 |
| commit | 353c38e23108856daa2c5d0e86443ac5136dcaa7 (patch) | |
| tree | bd899dd541543d6fa875d534a7d571b2baa087b0 /lib/CodeGen/Designator.cc | |
| parent | 9ef1cc2424e5afa21d3980b56046f5fb71bff89f (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/Designator.cc')
| -rw-r--r-- | lib/CodeGen/Designator.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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)) { |
