diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-05-31 00:42:24 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:47:57 -0700 |
| commit | 26fac15f485e89dc7106256e1aa79184c1761efd (patch) | |
| tree | 59f0c3a453e0789f989bf096fe6fe235a6865b14 /src | |
| parent | d019229c2c3432c9053594eb140b255c3be9ebeb (diff) | |
| download | zig-26fac15f485e89dc7106256e1aa79184c1761efd.tar.gz zig-26fac15f485e89dc7106256e1aa79184c1761efd.zip | |
math.big.int: fix ctz of zero
Diffstat (limited to 'src')
| -rw-r--r-- | src/value.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/value.zig b/src/value.zig index 89ba1fba67..62a83c7901 100644 --- a/src/value.zig +++ b/src/value.zig @@ -1216,10 +1216,10 @@ pub const Value = struct { return bigint.clz(ty.intInfo(mod).bits); } - pub fn ctz(val: Value, _: Type, mod: *Module) u64 { + pub fn ctz(val: Value, ty: Type, mod: *Module) u64 { var bigint_buf: BigIntSpace = undefined; const bigint = val.toBigInt(&bigint_buf, mod); - return bigint.ctz(); + return bigint.ctz(ty.intInfo(mod).bits); } pub fn popCount(val: Value, ty: Type, mod: *Module) u64 { |
