aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-30 12:14:02 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-04-30 12:14:02 -0700
commit91b4729962ddec96d1ee60d742326da828dae94a (patch)
tree21cd0216869d9b34bc1b90d243df8635842538de /src/value.zig
parentab086b62cf585aa7fa73f2df3332e87f60226f86 (diff)
downloadzig-91b4729962ddec96d1ee60d742326da828dae94a.tar.gz
zig-91b4729962ddec96d1ee60d742326da828dae94a.zip
fix compilation error on 32-bit LLVM-enabled compiler builds
Fixes a regression introduced in 9295355985202c267b4326b5a6e2ad5158b48e5d that caused 32-bit builds with `-Denable-llvm` to fail to build from source due to that common u64/usize casting issue.
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/value.zig b/src/value.zig
index 16ccc0c642..503797abba 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -5390,7 +5390,7 @@ pub const Value = extern union {
/// have the same value, return that byte value, otherwise null.
pub fn hasRepeatedByteRepr(val: Value, ty: Type, mod: *Module, value_buffer: *Payload.U64) !?Value {
const target = mod.getTarget();
- const abi_size = ty.abiSize(target);
+ const abi_size = std.math.cast(usize, ty.abiSize(target)) orelse return null;
assert(abi_size >= 1);
const byte_buffer = try mod.gpa.alloc(u8, abi_size);
defer mod.gpa.free(byte_buffer);