Merge pull request #901 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mono / metadata / debug-helpers.c
index afeb91bbf13cf226d040aada2ffbaf981ca5cd32..a20e8ae06e03a9ade8d5e64419f4d0a4b9122220 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * console-io.c: ConsoleDriver internal calls
+ * debug-helpers.c:
  *
  * Author:
  *     Mono Project (http://www.mono-project.com)
@@ -326,10 +326,10 @@ mono_method_desc_new (const char *name, gboolean include_namespace)
                g_free (class_nspace);
                return NULL;
        }
-       *method_name++ = 0;
        /* allow two :: to separate the method name */
-       if (*method_name == ':')
-               method_name++;
+       if (method_name != class_nspace && method_name [-1] == ':')
+               method_name [-1] = 0;
+       *method_name++ = 0;
        class_name = strrchr (class_nspace, '.');
        if (class_name) {
                *class_name++ = 0;
@@ -468,6 +468,8 @@ match_class (MonoMethodDesc *desc, int pos, MonoClass *klass)
 gboolean
 mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method)
 {
+       if (!desc->klass)
+               return FALSE;
        if (!match_class (desc, strlen (desc->klass), method->klass))
                return FALSE;
 
@@ -1020,4 +1022,3 @@ mono_class_describe_statics (MonoClass* klass)
                }
        }
 }
-