[runtime] Fix detecting abort at end of abort protected block
[mono.git] / mono / mini / mini-trampolines.c
index c01f6eaebf4ab2f3bb6f0ebf03c5ca0c4deb8b8b..737c6a3700255a9ac98f292227f6051d630790b0 100644 (file)
 #include "mini.h"
 #include "lldb.h"
 
+#ifdef ENABLE_INTERPRETER
+#include "interp/interp.h"
+#endif
+
 /*
  * Address of the trampoline code.  This is used by the debugger to check
  * whether a method is a trampoline.
@@ -1288,7 +1292,7 @@ mono_handler_block_guard_trampoline (mgreg_t *regs, guint8 *code, gpointer *tram
        if (!resume_ip) /*this should not happen, but we should avoid crashing */
                exc = mono_get_exception_execution_engine ("Invalid internal state, resuming abort after handler block but no resume ip found");
        else
-               exc = mono_thread_resume_interruption ();
+               exc = mono_thread_resume_interruption (TRUE);
 
        if (exc) {
                mono_handle_exception (&ctx, (MonoObject *)exc);
@@ -1459,6 +1463,15 @@ mono_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean ad
 
        error_init (error);
 
+#ifdef ENABLE_INTERPRETER
+       if (mono_use_interpreter) {
+               gpointer ret = mono_interp_create_trampoline (domain, method, error);
+               if (!mono_error_ok (error))
+                       return NULL;
+               return ret;
+       }
+#endif
+
        code = mono_jit_find_compiled_method_with_jit_info (domain, method, &ji);
        /*
         * We cannot recover the correct type of a shared generic
@@ -1636,7 +1649,7 @@ no_delegate_trampoline (void)
 gpointer
 mono_create_delegate_trampoline (MonoDomain *domain, MonoClass *klass)
 {
-       if (mono_llvm_only)
+       if (mono_llvm_only || mono_use_interpreter)
                return no_delegate_trampoline;
 
        return mono_create_delegate_trampoline_info (domain, klass, NULL)->invoke_impl;