Merge pull request #13744 from Vexu/stage2-fixes
Improve error messages, fix dependency loops
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user