mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-26 15:11:37 +00:00
Add missing .rev()
on parameter list and simulate "red zone".
This commit is contained in:
@ -1063,7 +1063,7 @@ impl X64FunctionCode {
|
|||||||
let mut call_movs: Vec<(Location, GPR)> = vec![];
|
let mut call_movs: Vec<(Location, GPR)> = vec![];
|
||||||
|
|
||||||
// Prepare register & stack parameters.
|
// Prepare register & stack parameters.
|
||||||
for (i, param) in params.iter().enumerate() {
|
for (i, param) in params.iter().enumerate().rev() {
|
||||||
let loc = Machine::get_param_location(1 + i);
|
let loc = Machine::get_param_location(1 + i);
|
||||||
match loc {
|
match loc {
|
||||||
Location::GPR(x) => {
|
Location::GPR(x) => {
|
||||||
@ -1396,6 +1396,8 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
|||||||
.machine
|
.machine
|
||||||
.init_locals(a, self.num_locals, self.num_params);
|
.init_locals(a, self.num_locals, self.num_params);
|
||||||
|
|
||||||
|
a.emit_sub(Size::S64, Location::Imm32(32), Location::GPR(GPR::RSP)); // simulate "red zone" if not supported by the platform
|
||||||
|
|
||||||
self.control_stack.push(ControlFrame {
|
self.control_stack.push(ControlFrame {
|
||||||
label: a.get_label(),
|
label: a.get_label(),
|
||||||
loop_like: false,
|
loop_like: false,
|
||||||
|
Reference in New Issue
Block a user