Commit 41ee0877 by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

re PR java/2598 (Runtime crash regression accessing field from enclosing class from inner class)

2001-05-07  Alexandre Petit-Bianco  <apbianco@redhat.com>

        * parse.y (fix_constructors): Removed unecessary assignment to
        local. Moved assignment to `this$<n>', fixed comments and
        indentation.
        (build_wfl_wrap): Fixed indentation.
        Fixes PR java/2598, java/2579 and java/2658.

(http://gcc.gnu.org/ml/gcc-patches/2001-05/msg00412.html )

From-SVN: r41905
parent 5c8cfcd6
2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (fix_constructors): Removed unecessary assignment to
local. Moved assignment to `this$<n>', fixed comments and
indentation.
(build_wfl_wrap): Fixed indentation.
Fixes PR java/2598, java/2579 and java/2658.
2001-05-03 Mo DeJong <mdejong@redhat.com> 2001-05-03 Mo DeJong <mdejong@redhat.com>
* lex.c (java_new_lexer): Call iconv_close on temp handle used to * lex.c (java_new_lexer): Call iconv_close on temp handle used to
......
...@@ -8500,7 +8500,7 @@ fix_constructors (mdecl) ...@@ -8500,7 +8500,7 @@ fix_constructors (mdecl)
/* We don't generate a super constructor invocation if we're /* We don't generate a super constructor invocation if we're
compiling java.lang.Object. build_super_invocation takes care compiling java.lang.Object. build_super_invocation takes care
of that. */ of that. */
compound = java_method_add_stmt (mdecl, build_super_invocation (mdecl)); java_method_add_stmt (mdecl, build_super_invocation (mdecl));
/* Insert the instance initializer block right here, after the /* Insert the instance initializer block right here, after the
super invocation. */ super invocation. */
...@@ -8536,13 +8536,17 @@ fix_constructors (mdecl) ...@@ -8536,13 +8536,17 @@ fix_constructors (mdecl)
found = 0; found = 0;
body = NULL_TREE; body = NULL_TREE;
} }
/* Generate the assignment to this$<n>, if necessary */
if ((thisn_assign = build_thisn_assign ()))
compound = add_stmt_to_compound (compound, NULL_TREE, thisn_assign);
/* The constructor is missing an invocation of super() */ /* The constructor is missing an invocation of super() */
if (!found) if (!found)
compound = add_stmt_to_compound (compound, NULL_TREE, compound = add_stmt_to_compound (compound, NULL_TREE,
build_super_invocation (mdecl)); build_super_invocation (mdecl));
/* Explicit super() invokation should take place before the
/* Explicit super() invokation should be kept as the first instance initializer blocks. */
statement, we move it. */
else else
{ {
compound = add_stmt_to_compound (compound, NULL_TREE, compound = add_stmt_to_compound (compound, NULL_TREE,
...@@ -8550,10 +8554,6 @@ fix_constructors (mdecl) ...@@ -8550,10 +8554,6 @@ fix_constructors (mdecl)
TREE_OPERAND (found_call, 0) = empty_stmt_node; TREE_OPERAND (found_call, 0) = empty_stmt_node;
} }
/* Generate the assignment to this$<n>, if necessary */
if ((thisn_assign = build_thisn_assign ()))
compound = add_stmt_to_compound (compound, NULL_TREE, thisn_assign);
/* Insert the instance initializer block right after. */ /* Insert the instance initializer block right after. */
if ((ii = build_instance_initializer (mdecl))) if ((ii = build_instance_initializer (mdecl)))
compound = add_stmt_to_compound (compound, NULL_TREE, ii); compound = add_stmt_to_compound (compound, NULL_TREE, ii);
...@@ -10110,7 +10110,7 @@ patch_method_invocation (patch, primary, where, from_super, ...@@ -10110,7 +10110,7 @@ patch_method_invocation (patch, primary, where, from_super,
/* Prepare to pass hidden parameters to finit$, if any. */ /* Prepare to pass hidden parameters to finit$, if any. */
finit_parms = build_alias_initializer_parameter_list finit_parms = build_alias_initializer_parameter_list
(AIPL_FUNCTION_FINIT_INVOCATION, current_class, NULL_TREE, NULL); (AIPL_FUNCTION_FINIT_INVOCATION, current_class, NULL_TREE, NULL);
finit_call = finit_call =
build_method_invocation (build_wfl_node (finit_identifier_node), build_method_invocation (build_wfl_node (finit_identifier_node),
finit_parms); finit_parms);
...@@ -11973,6 +11973,7 @@ maybe_absorb_scoping_blocks () ...@@ -11973,6 +11973,7 @@ maybe_absorb_scoping_blocks ()
are completing them. */ are completing them. */
/* Wrap a non WFL node around a WFL. */ /* Wrap a non WFL node around a WFL. */
static tree static tree
build_wfl_wrap (node, location) build_wfl_wrap (node, location)
tree node; tree node;
...@@ -11993,7 +11994,6 @@ build_wfl_wrap (node, location) ...@@ -11993,7 +11994,6 @@ build_wfl_wrap (node, location)
return wfl; return wfl;
} }
/* Build a super() constructor invocation. Returns empty_stmt_node if /* Build a super() constructor invocation. Returns empty_stmt_node if
we're currently dealing with the class java.lang.Object. */ we're currently dealing with the class java.lang.Object. */
......
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