aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-09-21 17:24:55 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-09-21 23:21:07 -0700
commit0e2b9ac7770df07212d4d1cbfb15c3aaed0bef18 (patch)
tree84aa414d185d628269743a644188dcdfd8e8497e /src/Sema.zig
parentbe71195bba13256f0e0a955833b2ada3a27492fc (diff)
downloadzig-0e2b9ac7770df07212d4d1cbfb15c3aaed0bef18.tar.gz
zig-0e2b9ac7770df07212d4d1cbfb15c3aaed0bef18.zip
stage2: fix unsigned integer to signed integer coercion
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index f6bea69129..91d12b7b31 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -9565,7 +9565,7 @@ fn coerce(
const src_info = inst_ty.intInfo(target);
if ((src_info.signedness == dst_info.signedness and dst_info.bits >= src_info.bits) or
// small enough unsigned ints can get casted to large enough signed ints
- (src_info.signedness == .signed and dst_info.signedness == .unsigned and dst_info.bits > src_info.bits))
+ (dst_info.signedness == .signed and dst_info.bits > src_info.bits))
{
try sema.requireRuntimeBlock(block, inst_src);
return block.addTyOp(.intcast, dest_type, inst);