From fc850aad619cc47eb7634a326bad670b43964532 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 16 Aug 2020 16:24:00 +0200 Subject: [PATCH] stage2: fix signed <-> unsigned Value casts --- src-self-hosted/value.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-self-hosted/value.zig b/src-self-hosted/value.zig index b2fad9207d..c8af4716a6 100644 --- a/src-self-hosted/value.zig +++ b/src-self-hosted/value.zig @@ -562,7 +562,7 @@ pub const Value = extern union { .bool_true => return 1, .int_u64 => return self.cast(Payload.Int_u64).?.int, - .int_i64 => return @intCast(u64, self.cast(Payload.Int_u64).?.int), + .int_i64 => return @intCast(u64, self.cast(Payload.Int_i64).?.int), .int_big_positive => return self.cast(Payload.IntBigPositive).?.asBigInt().to(u64) catch unreachable, .int_big_negative => return self.cast(Payload.IntBigNegative).?.asBigInt().to(u64) catch unreachable, } @@ -636,7 +636,7 @@ pub const Value = extern union { .bool_true => return 1, - .int_u64 => return @intCast(i64, self.cast(Payload.Int_i64).?.int), + .int_u64 => return @intCast(i64, self.cast(Payload.Int_u64).?.int), .int_i64 => return self.cast(Payload.Int_i64).?.int, .int_big_positive => return self.cast(Payload.IntBigPositive).?.asBigInt().to(i64) catch unreachable, .int_big_negative => return self.cast(Payload.IntBigNegative).?.asBigInt().to(i64) catch unreachable,