[aot] Avoid an assert in mono_aot_jit_info_table_find () when the address is right...
authorZoltan Varga <vargaz@gmail.com>
Fri, 4 Sep 2015 23:22:07 +0000 (19:22 -0400)
committerZoltan Varga <vargaz@gmail.com>
Fri, 4 Sep 2015 23:22:07 +0000 (19:22 -0400)
mono/mini/aot-runtime.c

index ca4f58e074d9eb209c10737ac7a9c815248b7005..1b1e3fcc316af955545a9a23b41927c5ab65a0d1 100644 (file)
@@ -3180,11 +3180,10 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr)
        }
 
        //printf ("F: %s\n", mono_method_full_name (method, TRUE));
-       
+
        jinfo = decode_exception_debug_info (amodule, domain, method, ex_info, addr, code, code_len);
 
        g_assert ((guint8*)addr >= (guint8*)jinfo->code_start);
-       g_assert ((guint8*)addr < (guint8*)jinfo->code_start + jinfo->code_size);
 
        /* Add it to the normal JitInfo tables */
        if (async) {
@@ -3216,6 +3215,10 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr)
        } else {
                mono_jit_info_table_add (domain, jinfo);
        }
+
+       if ((guint8*)addr >= (guint8*)jinfo->code_start + jinfo->code_size)
+               /* addr is in the padding between methods, see the adjustment of code_size in decode_exception_debug_info () */
+               return NULL;
        
        return jinfo;
 }