diff options
| author | jsturm <jsturm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-03 23:44:07 +0000 |
|---|---|---|
| committer | jsturm <jsturm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-03 23:44:07 +0000 |
| commit | e2a5b0a180d80302819f8a4645a11dcaa3ed80e9 (patch) | |
| tree | 349600e331227c75b50d39540f2068ebdcd7d248 /gcc/java/parse.y | |
| parent | 4f995f00abde399342dec2beb66c17477221b9fc (diff) | |
| download | ppe42-gcc-e2a5b0a180d80302819f8a4645a11dcaa3ed80e9.tar.gz ppe42-gcc-e2a5b0a180d80302819f8a4645a11dcaa3ed80e9.zip | |
* java/parse.y (fix_constructors): Test if a CALL_EXPR invokes
`this'. If so, don't build instance initializers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43743 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/parse.y')
| -rw-r--r-- | gcc/java/parse.y | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index a56c8fc8b8b..ac062ad1cbb 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -8558,6 +8558,7 @@ fix_constructors (mdecl) else { int found = 0; + int invokes_this = 0; tree found_call = NULL_TREE; tree main_block = BLOCK_EXPR_BODY (body); tree ii; /* Instance Initializer */ @@ -8567,6 +8568,8 @@ fix_constructors (mdecl) { case CALL_EXPR: found = CALL_EXPLICIT_CONSTRUCTOR_P (body); + if (CALL_THIS_CONSTRUCTOR_P (body)) + invokes_this = 1; body = NULL_TREE; break; case COMPOUND_EXPR: @@ -8601,7 +8604,7 @@ fix_constructors (mdecl) } /* Insert the instance initializer block right after. */ - if ((ii = build_instance_initializer (mdecl))) + if (!invokes_this && (ii = build_instance_initializer (mdecl))) compound = add_stmt_to_compound (compound, NULL_TREE, ii); /* Fix the constructor main block if we're adding extra stmts */ |

