Merge pull request #2431 from alexanderkyte/tests_with_excludes
[mono.git] / mono / mini / mini-trampolines.c
index d40ace4cd3e242bd3dc7af301f0c31b4f10a0a15..f1fe616b9698634764f4397422a0056b694caf61 100644 (file)
@@ -954,8 +954,10 @@ mono_aot_trampoline (mgreg_t *regs, guint8 *code, guint8 *token_info,
 
        addr = mono_aot_get_method_from_token (mono_domain_get (), image, token);
        if (!addr) {
-               method = mono_get_method (image, token, NULL);
-               g_assert (method);
+               MonoError error;
+               method = mono_get_method_checked (image, token, NULL, NULL, &error);
+               if (!method)
+                       g_error ("Could not load AOT trampoline due to %s", mono_error_get_message (&error));
 
                /* Use the generic code */
                return mono_magic_trampoline (regs, code, method, tramp);