re GNATS gcj/46 (Static inializers compiled incorrectly)
authorAlexandre Petit-Bianco <apbianco@cygnus.com>
Tue, 21 Sep 1999 15:53:23 +0000 (15:53 +0000)
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>
Tue, 21 Sep 1999 15:53:23 +0000 (08:53 -0700)
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

gcc/java/ChangeLog
gcc/java/parse.c
gcc/java/parse.y

index acfd311456a94647b9ba2badb1c120289e4c7306..1d9ca39a58aecbf61515586a638ee06593cbb24b 100644 (file)
@@ -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,
index 7d8571e3c14e5c19e5e7da64801368b9872f3830..d19a78ca9d3bf2bc256c0ace8ff547ede8d9c7a0 100644 (file)
@@ -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);
 }
 
index 59b21444544d272dcde1a04a313c9ebf2db50be6..3d76576f801962980b06888a8d5e89702177aab6 100644 (file)
@@ -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);
 }