mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
riscv: update start.zig and restore ra from the proper stack offset
This commit is contained in:
parent
5e770407cf
commit
060c475fcd
@ -155,7 +155,7 @@ fn exit2(code: usize) noreturn {
|
||||
asm volatile ("ecall"
|
||||
:
|
||||
: [number] "{a7}" (94),
|
||||
[arg1] "{a0}" (0),
|
||||
[arg1] "{a0}" (code),
|
||||
: "rcx", "r11", "memory"
|
||||
);
|
||||
},
|
||||
|
||||
@ -287,7 +287,7 @@ fn mirPsuedo(emit: *Emit, inst: Mir.Inst.Index) !void {
|
||||
};
|
||||
|
||||
// Restore ra
|
||||
try emit.writeInstruction(Instruction.ld(.ra, stack_size - 16, .sp));
|
||||
try emit.writeInstruction(Instruction.ld(.ra, stack_size - 8, .sp));
|
||||
|
||||
// Restore s0
|
||||
try emit.writeInstruction(Instruction.ld(.s0, stack_size - 16, .sp));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user