authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-08-13 12:21:06+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-08-13 23:52:40+01:00
log3736aac77868b867e0d529a3c393069537836451
tree9c795a396dbbc13bca2043758f3f6b9fbd1e1d6b
parente304a478c0654e8a6c506eedbd5556f99ac79d6c

Dwarf: handle noreturn union fields in more places

A little clunky -- maybe the frontend should give an answer here -- but this patch makes sense with the surrounding logic just to fix the crash. Resolves: #24265

1 files changed, 2 insertions(+), 2 deletions(-)

src/link/Dwarf.zig+2-2
......@@ -3241,7 +3241,7 @@ fn updateComptimeNavInner(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPoo
32413241 const field_type: Type = .fromInterned(loaded_union.field_types.get(ip)[field_index]);
32423242 try wip_nav.refType(field_type);
32433243 try diw.writeUleb128(loaded_union.fieldAlign(ip, field_index).toByteUnits() orelse
3244 field_type.abiAlignment(zcu).toByteUnits().?);
3244 if (field_type.isNoReturn(zcu)) 1 else field_type.abiAlignment(zcu).toByteUnits().?);
32453245 }
32463246 try diw.writeUleb128(@intFromEnum(AbbrevCode.null));
32473247 break :tag .done;
......@@ -4599,7 +4599,7 @@ fn updateContainerTypeWriterError(
45994599 const field_type: Type = .fromInterned(loaded_union.field_types.get(ip)[field_index]);
46004600 try wip_nav.refType(field_type);
46014601 try diw.writeUleb128(loaded_union.fieldAlign(ip, field_index).toByteUnits() orelse
4602 field_type.abiAlignment(zcu).toByteUnits().?);
4602 if (field_type.isNoReturn(zcu)) 1 else field_type.abiAlignment(zcu).toByteUnits().?);
46034603 }
46044604 if (loaded_union.field_types.len > 0) try diw.writeUleb128(@intFromEnum(AbbrevCode.null));
46054605 },