authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-30 12:18:35+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-30 12:21:38+02:00
log6b6e336e07308fd23f3061b5be11407956b2a460
treecf50146baa470990de2a81348585a8a15513374f
parentb64fe53ad509a1f582483e886f8b740a59b379c3
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Build.Step.CheckObject: Truncate st_other before interpreting it

Tools are free to use the upper bits of this field for whatever; thus, tools that want to interpret the visibility type should truncate to 2 bits.

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

lib/std/Build/Step/CheckObject.zig+1-1
......@@ -2270,7 +2270,7 @@ const ElfDumper = struct {
22702270 try writer.print(" {s}", .{sym_bind});
22712271 }
22722272
2273 const sym_vis = @as(elf.STV, @enumFromInt(sym.st_other));
2273 const sym_vis = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other))));
22742274 try writer.print(" {s}", .{@tagName(sym_vis)});
22752275
22762276 const sym_name = switch (sym.st_type()) {