OSDN Git Service

2003-12-25 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Dec 2003 16:08:25 +0000 (16:08 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Dec 2003 16:08:25 +0000 (16:08 +0000)
        PR java/13404
        * parse.y: (catch_clause_parameter): Return early if $3, aka
        formal_parameter, is null.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75020 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 68086ee..277ba9b 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-25  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR java/13404
+       * parse.y: (catch_clause_parameter): Return early if $3, aka 
+       formal_parameter, is null.
+
 2003-12-20  Kazu Hirata  <kazu@cs.umass.edu>
 
        * class.c: Remove uses of "register" specifier in
index 02b445b..7dfb572 100644 (file)
@@ -1905,15 +1905,24 @@ catch_clause_parameter:
                     formal_parameter (CCBP). The formal parameter is
                     declared initialized by the appropriate function
                     call */
-                 tree ccpb = enter_block ();
-                 tree init = build_assignment
-                   (ASSIGN_TK, $2.location, TREE_PURPOSE ($3),
-                    build (JAVA_EXC_OBJ_EXPR, ptr_type_node));
-                 declare_local_variables (0, TREE_VALUE ($3),
-                                          build_tree_list (TREE_PURPOSE ($3),
-                                                           init));
-                 $$ = build1 (CATCH_EXPR, NULL_TREE, ccpb);
-                 EXPR_WFL_LINECOL ($$) = $1.location;
+                  tree ccpb;
+                  tree init;
+                  if ($3)
+                    {
+                      cppb = enter_block ();
+                      init = build_assignment
+                        (ASSIGN_TK, $2.location, TREE_PURPOSE ($3),
+                         build (JAVA_EXC_OBJ_EXPR, ptr_type_node));
+                      declare_local_variables (0, TREE_VALUE ($3),
+                                               build_tree_list 
+                                              (TREE_PURPOSE ($3), init));
+                      $$ = build1 (CATCH_EXPR, NULL_TREE, ccpb);
+                      EXPR_WFL_LINECOL ($$) = $1.location;
+                    }
+                  else
+                    {
+                      $$ = error_mark_node;
+                    }
                }
 |      CATCH_TK error
                {yyerror ("'(' expected"); RECOVER; $$ = NULL_TREE;}