aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-06-30 12:18:35 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-06-30 12:21:38 +0200
commit6b6e336e07308fd23f3061b5be11407956b2a460 (patch)
treecf50146baa470990de2a81348585a8a15513374f /lib/std/Build
parentb64fe53ad509a1f582483e886f8b740a59b379c3 (diff)
downloadzig-6b6e336e07308fd23f3061b5be11407956b2a460.tar.gz
zig-6b6e336e07308fd23f3061b5be11407956b2a460.zip
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.
Diffstat (limited to 'lib/std/Build')
-rw-r--r--lib/std/Build/Step/CheckObject.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/Build/Step/CheckObject.zig b/lib/std/Build/Step/CheckObject.zig
index c2ff85c6f1..3b78258d1c 100644
--- a/lib/std/Build/Step/CheckObject.zig
+++ b/lib/std/Build/Step/CheckObject.zig
@@ -2270,7 +2270,7 @@ const ElfDumper = struct {
try writer.print(" {s}", .{sym_bind});
}
- const sym_vis = @as(elf.STV, @enumFromInt(sym.st_other));
+ const sym_vis = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other))));
try writer.print(" {s}", .{@tagName(sym_vis)});
const sym_name = switch (sym.st_type()) {