diff --git a/src/mono/mono/mini/mini-arm64.c b/src/mono/mono/mini/mini-arm64.c index f65c45313ea71f..572cf53831c984 100644 --- a/src/mono/mono/mini/mini-arm64.c +++ b/src/mono/mono/mini/mini-arm64.c @@ -4203,8 +4203,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) guint32 val; arm_ldrx (code, ARMREG_IP1, info_var->inst_basereg, GTMREG_TO_INT (info_var->inst_offset)); - /* Add the bp_tramp_offset */ - val = ((bp_tramp_offset / 4) * sizeof (target_mgreg_t)) + MONO_STRUCT_OFFSET (SeqPointInfo, bp_addrs); + val = (bp_tramp_offset * sizeof (target_mgreg_t)) + MONO_STRUCT_OFFSET (SeqPointInfo, bp_addrs); /* Load the info->bp_addrs [bp_tramp_offset], which is either 0 or the address of the bp trampoline */ code = emit_ldrx (code, ARMREG_IP1, ARMREG_IP1, val); /* Skip the load if its 0 */ @@ -6876,9 +6875,7 @@ mono_arch_set_breakpoint (MonoJitInfo *ji, guint8 *ip) if (enable_ptrauth) NOT_IMPLEMENTED; - g_assert (native_offset % 4 == 0); - g_assert (info->bp_addrs [native_offset / 4] == 0); - info->bp_addrs [native_offset / 4] = (guint8*)mini_get_breakpoint_trampoline (); + info->bp_addrs [native_offset] = (guint8*)mini_get_breakpoint_trampoline (); } else { /* ip points to an ldrx */ code += 4; @@ -6901,8 +6898,7 @@ mono_arch_clear_breakpoint (MonoJitInfo *ji, guint8 *ip) if (enable_ptrauth) NOT_IMPLEMENTED; - g_assert (native_offset % 4 == 0); - info->bp_addrs [native_offset / 4] = NULL; + info->bp_addrs [native_offset] = NULL; } else { /* ip points to an ldrx */ code += 4;