2003-09-17 Ranjit Mathew <rmathew@hotmail.com>
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Sep 2003 15:26:59 +0000 (15:26 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Sep 2003 15:26:59 +0000 (15:26 +0000)
Fixes PR java/9577
* mangle.c (find_compression_record_match): Skip
over a "6JArray" (the array template mangled string)
IDENTIFIER_NODE.
(mangle_array_type): Correct minor typo.
(atms): Move definition to the beginning.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71461 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/mangle.c

index 385cd85..a3cee95 100644 (file)
@@ -1,3 +1,12 @@
+2003-09-17  Ranjit Mathew  <rmathew@hotmail.com>
+
+       Fixes PR java/9577
+       * mangle.c (find_compression_record_match): Skip
+       over a "6JArray" (the array template mangled string)
+       IDENTIFIER_NODE.
+       (mangle_array_type): Correct minor typo.
+       (atms): Move definition to the beginning.
+
 2003-09-16  Bryce McKinlay  <bryce@mckinlay.net.nz>
 
        * class.c (add_miranda_methods): Ensure super-interfaces are laid 
index ca5997c..e545cbc 100644 (file)
@@ -67,6 +67,9 @@ struct obstack *mangle_obstack;
 #define MANGLE_RAW_STRING(S) \
   obstack_grow (mangle_obstack, (S), sizeof (S)-1)
 
+/* atms: array template mangled string. */
+static GTY(()) tree atms;
+
 /* This is the mangling interface: a decl, a class field (.class) and
    the vtable. */
 
@@ -233,7 +236,7 @@ mangle_type (tree type)
    already seen, so they can be reused. For example, java.lang.Object
    would generate three entries: two package names and a type. If
    java.lang.String is presented next, the java.lang will be matched
-   against the first two entries (and kept for compression as S_0), and
+   against the first two entries (and kept for compression as S0_), and
    type String would be added to the table. See mangle_record_type.
    COMPRESSION_NEXT is the index to the location of the next insertion
    of an element.  */
@@ -301,12 +304,16 @@ find_compression_record_match (tree type, tree *next_current)
            i++;
            break;
          }
+        else if (atms && TREE_VEC_ELT (compression_table, j) == atms)
+          {
+            /* Skip over a "6JArray". */
+          }
        else
          {
            /* We don't want to match an element that appears in the middle
            of a package name, so skip forward to the next complete type name.
-           IDENTIFIER_NODEs are partial package names while RECORD_TYPEs
-           represent complete type names. */
+           IDENTIFIER_NODEs (except for a "6JArray") are partial package
+            names while RECORD_TYPEs represent complete type names. */
            while (j < compression_next 
                   && TREE_CODE (TREE_VEC_ELT (compression_table, j)) == 
                      IDENTIFIER_NODE)
@@ -413,11 +420,9 @@ mangle_pointer_type (tree type)
 
 /* Mangle an array type. Search for an easy solution first, then go
    through the process of finding out whether the bare array type or even
-   the template indicator where already used an compress appropriately.
+   the template indicator were already used and compressed appropriately.
    It handles pointers. */
 
-/* atms: array template mangled string. */
-static GTY(()) tree atms;
 static void
 mangle_array_type (tree p_type)
 {
@@ -436,7 +441,7 @@ mangle_array_type (tree p_type)
       atms = get_identifier ("6JArray");
     }
 
-  /* Maybe we have what we're looking in the compression table. */
+  /* Maybe we have what we're looking for in the compression table. */
   if ((match = find_compression_array_match (p_type)) >= 0)
     {
       emit_compression_string (match);