From: Zoltan Varga Date: Thu, 6 Jul 2017 18:27:08 +0000 (-0400) Subject: [arm64] Fix the handler block trampoline, it didn't actually call the helper function. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=8aaf80d0112c6bcac934670cb2cac7ee1cbf26a0;hp=dc2e330a9ff2d5c5271693d5b8d685aa8c0dd3b2;p=mono.git [arm64] Fix the handler block trampoline, it didn't actually call the helper function. --- diff --git a/mono/mini/tramp-arm64.c b/mono/mini/tramp-arm64.c index cf4057a9434..7bacbab79dd 100644 --- a/mono/mini/tramp-arm64.c +++ b/mono/mini/tramp-arm64.c @@ -539,14 +539,16 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot) /* * We are in a method frame after the call emitted by OP_CALL_HANDLER. */ + /* Call a helper to obtain jit_tls->handler_block_return_address */ if (aot) code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_arm_handler_block_trampoline_helper"); else code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)mono_arm_handler_block_trampoline_helper); + arm_blrx (code, ARMREG_IP0); /* Set it as the return address so the trampoline will return to it */ arm_movx (code, ARMREG_LR, ARMREG_IP0); - /* Call the trampoline */ + /* Call the C trampoline function */ if (aot) { char *name = g_strdup_printf ("trampoline_func_%d", MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD); code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, name);