re PR java/17329 (ICE: SEGV in java_gimplify_expr)
authorTom Tromey <tromey@redhat.com>
Thu, 23 Sep 2004 16:25:37 +0000 (16:25 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 23 Sep 2004 16:25:37 +0000 (16:25 +0000)
PR java/17329:
* java-gimplify.c (java_gimplify_expr) <SAVE_EXPR>: Ignore case
where operand is null.

From-SVN: r87961

gcc/java/ChangeLog
gcc/java/java-gimplify.c

index e172f97fa979e919f3aa4ebcec31a6276a018e5c..e75ebd052d98bd211b182ecc73c67c9aac12af23 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-23  Tom Tromey  <tromey@redhat.com>
+
+       PR java/17329:
+       * java-gimplify.c (java_gimplify_expr) <SAVE_EXPR>: Ignore case
+       where operand is null.
+
 2004-09-23  Tom Tromey  <tromey@redhat.com>
 
        PR java/17380:
index 54d5c75447203a358148da0c0f065d446d577a0f..664eb9a6478ce3d1723c52fed8a7db326cdc80a1 100644 (file)
@@ -108,7 +108,10 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
       return GS_UNHANDLED;
 
     case SAVE_EXPR:
-      if (TREE_CODE (TREE_OPERAND (*expr_p, 0)) == VAR_DECL)
+      /* Note that we can see <save_expr NULL> if the save_expr was
+        already handled by gimplify_save_expr.  */
+      if (TREE_OPERAND (*expr_p, 0) != NULL_TREE
+         && TREE_CODE (TREE_OPERAND (*expr_p, 0)) == VAR_DECL)
        TREE_OPERAND (*expr_p, 0) 
          = java_replace_reference (TREE_OPERAND (*expr_p, 0), 
                               /* want_lvalue */ false);