mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
stage2: return Value.zero when truncating int to 0 bits at comptime
This commit is contained in:
parent
2d8fef5680
commit
3f4676901a
@ -3359,6 +3359,8 @@ pub const Value = extern union {
|
||||
}
|
||||
|
||||
pub fn intTrunc(val: Value, allocator: Allocator, signedness: std.builtin.Signedness, bits: u16) !Value {
|
||||
if (bits == 0) return Value.zero;
|
||||
|
||||
var val_space: Value.BigIntSpace = undefined;
|
||||
const val_bigint = val.toBigInt(&val_space);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user