Commit 2cb3951d by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

parse.y (patch_method_invocation): NULLify this_arg when already inserted.

2000-10-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (patch_method_invocation): NULLify this_arg when already
	inserted.
	(maybe_use_access_method): Handle call to methods unrelated to the
	current class. Fixed comment.
	Fixes gcj/361.

(http://sources.redhat.com/ml/java-prs/2000-q4/msg00072.html
 http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00993.html)

From-SVN: r37139
parent 661a98d1
...@@ -10,6 +10,14 @@ ...@@ -10,6 +10,14 @@
* Makefile.in: Delete. * Makefile.in: Delete.
* config-lang.in: Delete outputs= line. * config-lang.in: Delete outputs= line.
2000-10-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (patch_method_invocation): NULLify this_arg when already
inserted.
(maybe_use_access_method): Handle call to methods unrelated to the
current class. Fixed comment.
Fixes gcj/361.
2000-10-24 Tom Tromey <tromey@cygnus.com> 2000-10-24 Tom Tromey <tromey@cygnus.com>
* lex.c (java_new_lexer): Initialize new fields. Work around * lex.c (java_new_lexer): Initialize new fields. Work around
......
...@@ -9930,7 +9930,10 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl) ...@@ -9930,7 +9930,10 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
argument list. In the meantime, the selected function argument list. In the meantime, the selected function
might have be replaced by a generated stub. */ might have be replaced by a generated stub. */
if (maybe_use_access_method (is_super_init, &list, &this_arg)) if (maybe_use_access_method (is_super_init, &list, &this_arg))
{
args = tree_cons (NULL_TREE, this_arg, args); args = tree_cons (NULL_TREE, this_arg, args);
this_arg = NULL_TREE; /* So it doesn't get chained twice */
}
} }
} }
...@@ -10086,9 +10089,10 @@ maybe_use_access_method (is_super_init, mdecl, this_arg) ...@@ -10086,9 +10089,10 @@ maybe_use_access_method (is_super_init, mdecl, this_arg)
/* If we're calling a method found in an enclosing class, generate /* If we're calling a method found in an enclosing class, generate
what it takes to retrieve the right this. Don't do that if we're what it takes to retrieve the right this. Don't do that if we're
invoking a static method. */ invoking a static method. Note that if MD's type is unrelated to
CURRENT_CLASS, then the current this can be used. */
if (non_static_context) if (non_static_context && DECL_CONTEXT (md) != object_type_node)
{ {
ctx = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (current_class))); ctx = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (current_class)));
if (inherits_from_p (ctx, DECL_CONTEXT (md))) if (inherits_from_p (ctx, DECL_CONTEXT (md)))
......
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