2010-04-06 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Tue, 6 Apr 2010 16:47:18 +0000 (16:47 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 6 Apr 2010 16:47:18 +0000 (16:47 -0000)
* main.c: Prevent a crash with broken assemblies.

svn path=/trunk/mono/; revision=154872

mono/dis/ChangeLog
mono/dis/main.c

index 5702fcacdd08bbe1687d711e62de140c4dc38a36..0d85d0636f43b61b11b6d4438f9a811ee7bc31bd 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-06  Miguel de Icaza  <miguel@novell.com>
+
+       * main.c: Prevent a crash with broken assemblies.
+
 2010-03-30  Raja R Harinath  <harinath@hurrynot.org>
 
        Clean up some whitespace in the output
index 4578e3fe8bac7d4b1b27a26ef5214ecf541f1b3b..2cc3844c9324e744cd2122a90240afc7abcfa48e 100644 (file)
@@ -859,8 +859,12 @@ dis_method_list (const char *klass_name, MonoImage *m, guint32 start, guint32 en
                        container = type_container;
 
                ms = mono_metadata_parse_method_signature_full (m, container, i + 1, sig, &sig);
-               sig_str = dis_stringify_method_signature (m, ms, i + 1, container, FALSE);
-               method_name = mono_metadata_string_heap (m, cols [MONO_METHOD_NAME]);
+               if (ms != NULL){
+                       sig_str = dis_stringify_method_signature (m, ms, i + 1, container, FALSE);
+                       method_name = mono_metadata_string_heap (m, cols [MONO_METHOD_NAME]);
+
+                       method_name = g_strdup ("<NULL METHOD SIGNATURE>");
+               }
 
                fprintf (output, "    // method line %d\n", i + 1);
                fprintf (output, "    .method %s", flags);