aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-12-03 00:42:11 -0500
committerGitHub <noreply@github.com>2022-12-03 00:42:11 -0500
commitfdbb0fb7b9c08ebff1b7e45ef89f7160f350d44c (patch)
tree714f2766c64ace45df1f7d67ca70be0c88193184 /src/codegen.zig
parentc43ac67f82cb5a022df67729aa1e6bebc22cfff2 (diff)
parentb500e0eb179218f5eb03408c09b5e5a928f0c46e (diff)
downloadzig-fdbb0fb7b9c08ebff1b7e45ef89f7160f350d44c.tar.gz
zig-fdbb0fb7b9c08ebff1b7e45ef89f7160f350d44c.zip
Merge pull request #13744 from Vexu/stage2-fixes
Improve error messages, fix dependency loops
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index d6b2ed7d93..2261ba3b94 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -472,7 +472,7 @@ pub fn generateSymbol(
if (info.bits <= 8) {
const x: u8 = switch (info.signedness) {
.unsigned => @intCast(u8, typed_value.val.toUnsignedInt(target)),
- .signed => @bitCast(u8, @intCast(i8, typed_value.val.toSignedInt())),
+ .signed => @bitCast(u8, @intCast(i8, typed_value.val.toSignedInt(target))),
};
try code.append(x);
return Result{ .appended = {} };
@@ -501,13 +501,13 @@ pub fn generateSymbol(
},
.signed => {
if (info.bits <= 16) {
- const x = @intCast(i16, typed_value.val.toSignedInt());
+ const x = @intCast(i16, typed_value.val.toSignedInt(target));
mem.writeInt(i16, try code.addManyAsArray(2), x, endian);
} else if (info.bits <= 32) {
- const x = @intCast(i32, typed_value.val.toSignedInt());
+ const x = @intCast(i32, typed_value.val.toSignedInt(target));
mem.writeInt(i32, try code.addManyAsArray(4), x, endian);
} else {
- const x = typed_value.val.toSignedInt();
+ const x = typed_value.val.toSignedInt(target);
mem.writeInt(i64, try code.addManyAsArray(8), x, endian);
}
},
@@ -549,13 +549,13 @@ pub fn generateSymbol(
},
.signed => {
if (info.bits <= 16) {
- const x = @intCast(i16, int_val.toSignedInt());
+ const x = @intCast(i16, int_val.toSignedInt(target));
mem.writeInt(i16, try code.addManyAsArray(2), x, endian);
} else if (info.bits <= 32) {
- const x = @intCast(i32, int_val.toSignedInt());
+ const x = @intCast(i32, int_val.toSignedInt(target));
mem.writeInt(i32, try code.addManyAsArray(4), x, endian);
} else {
- const x = int_val.toSignedInt();
+ const x = int_val.toSignedInt(target);
mem.writeInt(i64, try code.addManyAsArray(8), x, endian);
}
},