Skip to content

Commit

Permalink
[arm] amend stack pointer properly in exception trampoline (mono/mono…
Browse files Browse the repository at this point in the history
…#14310)

The previous attempt ( mono/mono#14078 ) only fixed it for ABIs where the stack pointer alignment is 8 bytes. ABIs, such as watchOS, require 16 byte alignment.

Commit migrated from mono/mono@1cbd5cb
  • Loading branch information
lewurm authored and directhex committed May 2, 2019
1 parent bd35282 commit e6b95e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mono/mono/mini/exceptions-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ get_throw_trampoline (int size, gboolean corlib, gboolean rethrow, gboolean llvm
int param_size = 8;
if (!resume_unwind && !corlib)
param_size += 4; // Extra arg
param_size = ALIGN_TO (param_size, MONO_ARCH_FRAME_ALIGNMENT);
/* SP isn't 16byte aligned at this point which matters for some targets */
param_size = ALIGN_TO (cfa_offset + param_size, MONO_ARCH_FRAME_ALIGNMENT) - cfa_offset;
ARM_SUB_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, param_size);
cfa_offset += param_size;
mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, cfa_offset);
Expand Down

0 comments on commit e6b95e1

Please sign in to comment.