fix V595 The 'amodule' pointer was utilized before it was verified against nullptr
authorEnrico Sada <enrico.sada@gmail.com>
Sat, 18 Aug 2012 14:18:45 +0000 (16:18 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 22 May 2014 07:45:51 +0000 (09:45 +0200)
mono/mini/aot-runtime.c

index f2a417faf86ff1046cf8b250654d3aec11dbcbb4..7ba90850d7ab0f8e6174274e103bf0a83f466dbd 100644 (file)
@@ -2771,7 +2771,7 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr)
        MonoJitInfo *jinfo;
        guint8 *code, *ex_info, *p;
        guint32 *table;
-       int nmethods = amodule->info.nmethods;
+       int nmethods;
        gint32 *code_offsets;
        int offsets_len, i;
        gboolean async;
@@ -2779,6 +2779,8 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr)
        if (!amodule)
                return NULL;
 
+       nmethods = amodule->info.nmethods;
+
        if (domain != mono_get_root_domain ())
                /* FIXME: */
                return NULL;