mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 15:13:08 +00:00
cbe: fix asm return values
This commit is contained in:
parent
3281494dc5
commit
7be6f352e3
@ -4108,6 +4108,8 @@ fn airAsm(f: *Function, inst: Air.Inst.Index) !CValue {
|
||||
if (is_reg) {
|
||||
try f.writeCValue(writer, .{ .local = locals_index }, .Other);
|
||||
locals_index += 1;
|
||||
} else if (output == .none) {
|
||||
try f.writeCValue(writer, local, .FunctionArgument);
|
||||
} else {
|
||||
try f.writeCValueDeref(writer, try f.resolveInst(output));
|
||||
}
|
||||
@ -4411,6 +4413,10 @@ fn structFieldPtr(f: *Function, inst: Air.Inst.Index, struct_ptr_ty: Type, struc
|
||||
u8_ptr_pl.data.pointee_type = Type.u8;
|
||||
const u8_ptr_ty = Type.initPayload(&u8_ptr_pl.base);
|
||||
|
||||
if (!std.mem.isAligned(byte_offset, field_ptr_ty.ptrAlignment(target))) {
|
||||
return f.fail("TODO: CBE: unaligned packed struct field pointer", .{});
|
||||
}
|
||||
|
||||
try writer.writeAll("&((");
|
||||
try f.renderTypecast(writer, u8_ptr_ty);
|
||||
try writer.writeByte(')');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user