aboutsummaryrefslogtreecommitdiff
path: root/src/link/Dwarf.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-09-12 13:32:14 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-09-12 20:08:56 -0400
commitcb6201715a7bcae2b278811186afc17a697b25f7 (patch)
tree30db7b0844d0769b87664e83164f734fae1a9627 /src/link/Dwarf.zig
parent7e2b6b0f1bc5877f11c50a217dd88c11481bbad4 (diff)
downloadzig-cb6201715a7bcae2b278811186afc17a697b25f7.tar.gz
zig-cb6201715a7bcae2b278811186afc17a697b25f7.zip
InternPool: prevent anon struct UAF bugs with type safety
Instead of using actual slices for InternPool.Key.AnonStructType, this commit changes to use Slice types instead, which store a long-lived index rather than a pointer. This is a follow-up to 7ef1eb1c27754cb0349fdc10db1f02ff2dddd99b.
Diffstat (limited to 'src/link/Dwarf.zig')
-rw-r--r--src/link/Dwarf.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/link/Dwarf.zig b/src/link/Dwarf.zig
index 252388cc8b..48c828e54a 100644
--- a/src/link/Dwarf.zig
+++ b/src/link/Dwarf.zig
@@ -327,7 +327,7 @@ pub const DeclState = struct {
// DW.AT.name, DW.FORM.string
try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(mod)});
- for (fields.types, 0..) |field_ty, field_index| {
+ for (fields.types.get(ip), 0..) |field_ty, field_index| {
// DW.AT.member
try dbg_info_buffer.append(@intFromEnum(AbbrevKind.struct_member));
// DW.AT.name, DW.FORM.string