for(i = 0; i < n_params; ++i) {
be_abi_call_arg_t *arg = get_call_arg(call, 0, i);
assert(arg);
- if(arg->on_stack) {
- stack_size += arg->space_before;
- stack_size = round_up2(stack_size, arg->alignment);
- stack_size += get_type_size_bytes(get_method_param_type(mt, i));
- stack_size += arg->space_after;
+ if (arg->on_stack) {
+ int arg_size = get_type_size_bytes(get_method_param_type(mt, i));
+
+ stack_size += round_up2(arg->space_before, arg->alignment);
+ stack_size += round_up2(arg_size, arg->alignment);
+ stack_size += round_up2(arg->space_after, arg->alignment);
obstack_int_grow(obst, i);
n_pos++;
}
/* set stack parameters */
for (i = stack_idx; i < n; i++) {
- be_abi_call_param_stack(abi, i, 1, 0, 0);
+ /* parameters on the stack are 32 bit aligned */
+ be_abi_call_param_stack(abi, i, 4, 0, 0);
}