mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 22:25:40 +00:00
Fix function calls.
This commit is contained in:
parent
dbebdf937f
commit
2432a6c9b3
@ -876,13 +876,13 @@ impl X64FunctionCode {
|
|||||||
if is_dword(size) {
|
if is_dword(size) {
|
||||||
dynasm!(
|
dynasm!(
|
||||||
assembler
|
assembler
|
||||||
; mov eax, [rsp + (total_size + 16 + caller_stack_offset) as i32]
|
; mov eax, [rsp + (total_size + 16 + saved_regs.len() * 8 + caller_stack_offset) as i32]
|
||||||
; mov [rsp + offset as i32], eax
|
; mov [rsp + offset as i32], eax
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
dynasm!(
|
dynasm!(
|
||||||
assembler
|
assembler
|
||||||
; mov rax, [rsp + (total_size + 16 + caller_stack_offset) as i32]
|
; mov rax, [rsp + (total_size + 16 + saved_regs.len() * 8 + caller_stack_offset) as i32]
|
||||||
; mov [rsp + offset as i32], rax
|
; mov [rsp + offset as i32], rax
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -910,6 +910,14 @@ impl X64FunctionCode {
|
|||||||
; jmp =>target
|
; jmp =>target
|
||||||
; after_call:
|
; after_call:
|
||||||
);
|
);
|
||||||
|
|
||||||
|
for reg in saved_regs.iter().rev() {
|
||||||
|
dynasm!(
|
||||||
|
assembler
|
||||||
|
; pop Rq(*reg as u8)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if caller_stack_offset != 0 {
|
if caller_stack_offset != 0 {
|
||||||
dynasm!(
|
dynasm!(
|
||||||
assembler
|
assembler
|
||||||
@ -929,13 +937,6 @@ impl X64FunctionCode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for reg in saved_regs.iter().rev() {
|
|
||||||
dynasm!(
|
|
||||||
assembler
|
|
||||||
; pop Rq(*reg as u8)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user