diff options
author | Ranjit Mathew <rmathew@hotmail.com> | 2003-09-17 15:26:59 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-09-17 15:26:59 +0000 |
commit | bdc225df147891d7b7d25248965c287e03f259f0 (patch) | |
tree | 354f4e8b822950fa085e3b8496381b41f9a2936c /gcc/java | |
parent | 25a017631e4436acdab266c85c043946affd07ae (diff) | |
download | gcc-bdc225df147891d7b7d25248965c287e03f259f0.zip gcc-bdc225df147891d7b7d25248965c287e03f259f0.tar.gz gcc-bdc225df147891d7b7d25248965c287e03f259f0.tar.bz2 |
re PR java/9577 (Linker error for legal Java/CNI code if method parameters are reversed)
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.
From-SVN: r71461
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/java/mangle.c | 19 |
2 files changed, 21 insertions, 7 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 385cd85..a3cee95 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -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 diff --git a/gcc/java/mangle.c b/gcc/java/mangle.c index ca5997c..e545cbc 100644 --- a/gcc/java/mangle.c +++ b/gcc/java/mangle.c @@ -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); |