diff options
| author | apbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-30 02:37:25 +0000 |
|---|---|---|
| committer | apbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-30 02:37:25 +0000 |
| commit | 12d2e97d306374638dd373d4453f4501de2a778d (patch) | |
| tree | f99896e3408c47839acc86752cecc450e462ec05 | |
| parent | ad5c72752be9904d6abb518ba900821c4b23f397 (diff) | |
| download | ppe42-gcc-12d2e97d306374638dd373d4453f4501de2a778d.tar.gz ppe42-gcc-12d2e97d306374638dd373d4453f4501de2a778d.zip | |
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)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37139 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/java/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/java/parse.y | 10 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 78d2cf851b0..363b6da61fd 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -10,6 +10,14 @@ * Makefile.in: Delete. * 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> * lex.c (java_new_lexer): Initialize new fields. Work around diff --git a/gcc/java/parse.y b/gcc/java/parse.y index fce75642764..b705fc6f594 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -9930,7 +9930,10 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl) argument list. In the meantime, the selected function might have be replaced by a generated stub. */ 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) /* 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 - 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))); if (inherits_from_p (ctx, DECL_CONTEXT (md))) |

