x64: update for new error union layout

This commit is contained in:
Jakub Konka
2022-05-23 23:07:12 +02:00
committed by Andrew Kelley
parent b42100c70f
commit 41f517e5f5
2 changed files with 175 additions and 78 deletions

View File

@@ -442,7 +442,10 @@ pub fn generateSymbol(
.Int => {
const info = typed_value.ty.intInfo(target);
if (info.bits <= 8) {
const x = @intCast(u8, typed_value.val.toUnsignedInt(target));
const x: u8 = switch (info.signedness) {
.unsigned => @intCast(u8, typed_value.val.toUnsignedInt(target)),
.signed => @bitCast(u8, @intCast(i8, typed_value.val.toSignedInt())),
};
try code.append(x);
return Result{ .appended = {} };
}