mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
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
This commit is contained in:
parent
e304a478c0
commit
3736aac778
1 changed files with 2 additions and 2 deletions
|
|
@ -3241,7 +3241,7 @@ fn updateComptimeNavInner(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPoo
|
|||
const field_type: Type = .fromInterned(loaded_union.field_types.get(ip)[field_index]);
|
||||
try wip_nav.refType(field_type);
|
||||
try diw.writeUleb128(loaded_union.fieldAlign(ip, field_index).toByteUnits() orelse
|
||||
field_type.abiAlignment(zcu).toByteUnits().?);
|
||||
if (field_type.isNoReturn(zcu)) 1 else field_type.abiAlignment(zcu).toByteUnits().?);
|
||||
}
|
||||
try diw.writeUleb128(@intFromEnum(AbbrevCode.null));
|
||||
break :tag .done;
|
||||
|
|
@ -4599,7 +4599,7 @@ fn updateContainerTypeWriterError(
|
|||
const field_type: Type = .fromInterned(loaded_union.field_types.get(ip)[field_index]);
|
||||
try wip_nav.refType(field_type);
|
||||
try diw.writeUleb128(loaded_union.fieldAlign(ip, field_index).toByteUnits() orelse
|
||||
field_type.abiAlignment(zcu).toByteUnits().?);
|
||||
if (field_type.isNoReturn(zcu)) 1 else field_type.abiAlignment(zcu).toByteUnits().?);
|
||||
}
|
||||
if (loaded_union.field_types.len > 0) try diw.writeUleb128(@intFromEnum(AbbrevCode.null));
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue