2004-12-10 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Fri, 10 Dec 2004 18:57:03 +0000 (18:57 -0000)
committerMartin Baulig <martin@novell.com>
Fri, 10 Dec 2004 18:57:03 +0000 (18:57 -0000)
* get.c (init_key_table): Added `type'.
(get_generic_param): Also escape the type parameter names.
Correctly handle multiple constraints.

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

mono/dis/ChangeLog
mono/dis/get.c

index 9cd316c204de997fe52b6b4bd17fbeb07c130d78..96e0b44d036c8b66d335ecf35eee163bfecabacd 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-10  Martin Baulig  <martin@ximian.com>
+
+       * get.c (init_key_table): Added `type'.
+       (get_generic_param): Also escape the type parameter names.
+       Correctly handle multiple constraints.
+
 2004-12-10  Martin Baulig  <martin@ximian.com>
 
        * get.c (get_fieldref_signature): Escape the field type and name
index 34a7e8d2e9b129c998af0fb3f67ac0b0e9222d04..4467d21c09a051d896c39bb4adeb12886fe929e6 100644 (file)
@@ -569,7 +569,9 @@ get_generic_param (MonoImage *m, MonoGenericContainer *container)
        for (i = 0; i < container->type_argc; i++) {
                MonoGenericParam *param = &container->type_params [i];
                MonoClass **constr;
+               int first = 1;
                guint16 flags;
+               char *esname;
 
                if (i > 0)
                        g_string_append (result, ",");
@@ -585,12 +587,22 @@ get_generic_param (MonoImage *m, MonoGenericContainer *container)
                for (constr = param->constraints; constr && *constr; constr++) {
                        char *sig;
 
+                       if (first) {
+                               g_string_append_c (result, '(');
+                               first = 0;
+                       } else
+                               g_string_append (result, ", ");
                        sig = dis_stringify_object_with_class (m, *constr, FALSE);
-                       g_string_append_printf (result, "(%s) ", sig);
+                       g_string_append (result, sig);
                        g_free (sig);
                 }
 
-               g_string_append (result, param->name);
+               if (!first)
+                       g_string_append (result, ") ");
+
+               esname = get_escaped_name (param->name);
+               g_string_append (result, esname);
+               g_free (esname);
        }
 
        g_string_append_c (result, '>');
@@ -2445,6 +2457,7 @@ init_key_table (void)
        g_hash_table_insert (key_table, (char *) "tls", GINT_TO_POINTER (TRUE));
        g_hash_table_insert (key_table, (char *) "to", GINT_TO_POINTER (TRUE));
        g_hash_table_insert (key_table, (char *) "true", GINT_TO_POINTER (TRUE));
+       g_hash_table_insert (key_table, (char *) "type", GINT_TO_POINTER (TRUE));
        g_hash_table_insert (key_table, (char *) "typedref", GINT_TO_POINTER (TRUE));
        g_hash_table_insert (key_table, (char *) "unicode", GINT_TO_POINTER (TRUE));
        g_hash_table_insert (key_table, (char *) "unmanagedexp", GINT_TO_POINTER (TRUE));