diff options
| author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-15 09:25:29 +0000 |
|---|---|---|
| committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-15 09:25:29 +0000 |
| commit | ad5b74d9577f34f9de8403b0a7f7799cfb5fbbef (patch) | |
| tree | c5b617427a61e67cbbeb9d9a804c1af659f1bc55 | |
| parent | 6f87fe3775e47e692adde4a8abff77eeecd366c0 (diff) | |
| download | ppe42-gcc-ad5b74d9577f34f9de8403b0a7f7799cfb5fbbef.tar.gz ppe42-gcc-ad5b74d9577f34f9de8403b0a7f7799cfb5fbbef.zip | |
Fix for PR java/6085:
* parse.y (patch_method_invocation): Always use build_access_to_thisn
to get enclosing "this" argument for inner-class constructor
invocation. Pass correct arguments to build_access_to_thisn.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52318 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/java/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/java/parse.y | 23 |
2 files changed, 13 insertions, 18 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4a22366441a..519b2aad000 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2002-04-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz> + + Fix for PR java/6085: + * parse.y (patch_method_invocation): Always use build_access_to_thisn + to get enclosing "this" argument for inner-class constructor + invocation. Pass correct arguments to build_access_to_thisn. + 2002-04-10 Andreas Jaeger <aj@suse.de> * gcj.texi (Input Options): Fix extdirs patch. @@ -26,6 +33,7 @@ * Make-lang.in: Compile jcf-path with version info for use in identifying the appropriate libgcj.jar. +>>>>>>> 1.982 2002-04-08 Tom Tromey <tromey@redhat.com> For PR libgcj/5303: diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 8c73b263019..b230abb250e 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -105,7 +105,6 @@ static void check_inner_class_access PARAMS ((tree, tree, tree)); static int check_pkg_class_access PARAMS ((tree, tree, bool)); static void register_package PARAMS ((tree)); static tree resolve_package PARAMS ((tree, tree *, tree *)); -static tree lookup_package_type PARAMS ((const char *, int)); static tree resolve_class PARAMS ((tree, tree, tree, tree)); static void declare_local_variables PARAMS ((int, tree, tree)); static void dump_java_tree PARAMS ((enum tree_dump_index, tree)); @@ -10466,27 +10465,15 @@ patch_method_invocation (patch, primary, where, from_super, /* This handles the situation where a constructor invocation needs to have an enclosing context passed as a second parameter (the - constructor is one of an inner class. We extract it from the - current function. */ + constructor is one of an inner class). */ if ((is_super_init || (TREE_CODE (patch) == CALL_EXPR && name == this_identifier_node)) && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { - tree enclosing_decl = DECL_CONTEXT (TYPE_NAME (current_class)); - tree extra_arg; - - if (ANONYMOUS_CLASS_P (current_class) || !DECL_CONTEXT (enclosing_decl)) - { - extra_arg = DECL_FUNCTION_BODY (current_function_decl); - extra_arg = TREE_CHAIN (BLOCK_EXPR_DECLS (extra_arg)); - } - else - { - tree dest = TREE_TYPE (DECL_CONTEXT (enclosing_decl)); - extra_arg = - build_access_to_thisn (TREE_TYPE (enclosing_decl), dest, 0); - extra_arg = java_complete_tree (extra_arg); - } + tree dest = TYPE_NAME (DECL_CONTEXT (list)); + tree extra_arg = + build_access_to_thisn (current_class, DECL_CONTEXT (dest), 0); + extra_arg = java_complete_tree (extra_arg); args = tree_cons (NULL_TREE, extra_arg, args); } |

