mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Use reg from StorageManager instead of XR while loading args
When a function returns via arg pointer, the caller sets XR (x8) to the address where the return value goes. We were sometimes using XR as a temporary register while loading args, which lead to a segfault when returning. It will now request a general available register from StorageManager instead.
This commit is contained in:
parent
905dc8cd59
commit
1021423e69
1 changed files with 4 additions and 1 deletions
|
@ -766,7 +766,8 @@ impl AArch64CallLoadArgs {
|
|||
in_layout,
|
||||
);
|
||||
|
||||
let tmp_reg = AArch64GeneralReg::XR;
|
||||
let tmp_sym = Symbol::DEV_TMP;
|
||||
let tmp_reg = storage_manager.claim_general_reg(buf, &tmp_sym);
|
||||
|
||||
super::x86_64::copy_to_base_offset::<_, _, AArch64Assembler>(
|
||||
buf,
|
||||
|
@ -777,6 +778,8 @@ impl AArch64CallLoadArgs {
|
|||
0,
|
||||
);
|
||||
|
||||
storage_manager.free_symbol(&tmp_sym);
|
||||
|
||||
self.general_i += 1;
|
||||
}
|
||||
None => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue