diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 1999-09-21 15:53:23 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 1999-09-21 08:53:23 -0700 |
commit | b771925e7ed1fa2d5f528fe515ab4698f2bd45c8 (patch) | |
tree | be78ec0ab69bf96c9106497110d0804c8922b48b /gcc/java | |
parent | 309dd885ff9f569aec12cb5e3281a3b4dd73a8e0 (diff) | |
download | gcc-b771925e7ed1fa2d5f528fe515ab4698f2bd45c8.zip gcc-b771925e7ed1fa2d5f528fe515ab4698f2bd45c8.tar.gz gcc-b771925e7ed1fa2d5f528fe515ab4698f2bd45c8.tar.bz2 |
re GNATS gcj/46 (Static inializers compiled incorrectly)
Thu Sep 16 15:42:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
instead of fndecl.
(This patch fixes the net Java PR #46:
http://sourceware.cygnus.com/ml/java-prs/1999-q3/msg00092.html)
From-SVN: r29550
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/parse.c | 4 | ||||
-rw-r--r-- | gcc/java/parse.y | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index acfd311..1d9ca39 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -6,6 +6,11 @@ * lang.c (lang_decode_option): Extend comment. +Thu Sep 16 15:42:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> + + * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK + instead of fndecl. + 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gjavah.c (get_field_name, print_method_info, print_include, diff --git a/gcc/java/parse.c b/gcc/java/parse.c index 7d8571e..d19a78c 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -8428,8 +8428,8 @@ tree java_method_add_stmt (fndecl, expr) tree fndecl, expr; { - if (!fndecl) - return NULL; + if (!GET_CURRENT_BLOCK (fndecl)) + return NULL_TREE; return add_stmt_to_block (GET_CURRENT_BLOCK (fndecl), NULL_TREE, expr); } diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 59b2144..3d76576 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -5841,8 +5841,8 @@ tree java_method_add_stmt (fndecl, expr) tree fndecl, expr; { - if (!fndecl) - return NULL; + if (!GET_CURRENT_BLOCK (fndecl)) + return NULL_TREE; return add_stmt_to_block (GET_CURRENT_BLOCK (fndecl), NULL_TREE, expr); } |