Commit bdc225df by Ranjit Mathew Committed by Tom Tromey

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
parent 25a01763
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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment