diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-12-03 00:42:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-03 00:42:11 -0500 |
| commit | fdbb0fb7b9c08ebff1b7e45ef89f7160f350d44c (patch) | |
| tree | 714f2766c64ace45df1f7d67ca70be0c88193184 /src/codegen.zig | |
| parent | c43ac67f82cb5a022df67729aa1e6bebc22cfff2 (diff) | |
| parent | b500e0eb179218f5eb03408c09b5e5a928f0c46e (diff) | |
| download | zig-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.zig | 14 |
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); } }, |
