aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-06-14 07:18:28 -0700
committerGitHub <noreply@github.com>2023-06-14 07:18:28 -0700
commit496320d9350971fca063d5297ab42ddd9c4dbe79 (patch)
tree11157d630fecd58a2606e3ec819bd41d5cc8745e /src/Module.zig
parent666ae24816541e80e3cf9f5d4d73dcce7c4481de (diff)
parent8a92beb088c5eb890f0b662ca6e0c8d68b72fd6a (diff)
downloadzig-496320d9350971fca063d5297ab42ddd9c4dbe79.tar.gz
zig-496320d9350971fca063d5297ab42ddd9c4dbe79.zip
Merge pull request #15726 from mlugg/feat/peer-type-resolution-but-better
Sema: rewrite peer type resolution
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig
index d60f3919a5..e8cea97b8f 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -6978,7 +6978,7 @@ pub fn intBitsForValue(mod: *Module, val: Value, sign: bool) u16 {
assert(sign);
// Protect against overflow in the following negation.
if (x == std.math.minInt(i64)) return 64;
- return Type.smallestUnsignedBits(@intCast(u64, -x - 1)) + 1;
+ return Type.smallestUnsignedBits(@intCast(u64, -(x + 1))) + 1;
},
.u64 => |x| {
return Type.smallestUnsignedBits(x) + @boolToInt(sign);