From 97e1d0af16beb7b12275e099115caa959d09bfbe Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Tue, 18 Jun 2019 23:46:00 +0200 Subject: [PATCH] [arm] fix some more host/target pointer size issues (mono/mono#15223) [arm] fix some more host/target pointer size issues As suggested by Jay in https://github.com/mono/mono/issues/15058#issuecomment-501995400 I haven't seen fixing it any specific issue, but we should still backport it to `2019-06` in order to avoid hard-to-debug regressions. Contributes to https://github.com/mono/mono/issues/9621 Commit migrated from https://github.com/mono/mono/commit/e3f8596156003c0c74b10f75ea9a8657e767afb3 --- src/mono/mono/mini/mini-arm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mono/mono/mini/mini-arm.c b/src/mono/mono/mini/mini-arm.c index 86d71f7..be2c42d 100644 --- a/src/mono/mono/mini/mini-arm.c +++ b/src/mono/mono/mini/mini-arm.c @@ -6993,10 +6993,10 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTC if (large_offsets) { ARM_PUSH4 (code, ARMREG_R0, ARMREG_R1, ARMREG_IP, ARMREG_PC); - mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, 4 * sizeof (host_mgreg_t)); + mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, 4 * sizeof (target_mgreg_t)); } else { ARM_PUSH2 (code, ARMREG_R0, ARMREG_R1); - mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, 2 * sizeof (host_mgreg_t)); + mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, 2 * sizeof (target_mgreg_t)); } ARM_LDR_IMM (code, ARMREG_R0, ARMREG_LR, -4); vtable_target = code; @@ -7074,8 +7074,8 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTC } else { ARM_POP2 (code, ARMREG_R0, ARMREG_R1); if (large_offsets) { - mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, 2 * sizeof (host_mgreg_t)); - ARM_ADD_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, 2 * sizeof (host_mgreg_t)); + mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, 2 * sizeof (target_mgreg_t)); + ARM_ADD_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, 2 * sizeof (target_mgreg_t)); } mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, 0); ARM_LDR_IMM (code, ARMREG_PC, ARMREG_IP, vtable_offset); @@ -7089,7 +7089,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTC /* Load target address */ ARM_LDR_IMM (code, ARMREG_R1, ARMREG_PC, 0); /* Save it to the fourth slot */ - ARM_STR_IMM (code, ARMREG_R1, ARMREG_SP, 3 * sizeof (host_mgreg_t)); + ARM_STR_IMM (code, ARMREG_R1, ARMREG_SP, 3 * sizeof (target_mgreg_t)); /* Restore registers and branch */ ARM_POP4 (code, ARMREG_R0, ARMREG_R1, ARMREG_IP, ARMREG_PC); -- 2.7.4