aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2004-09-23 16:25:37 +0000
committerTom Tromey <tromey@gcc.gnu.org>2004-09-23 16:25:37 +0000
commitfd5f23d3a60e9271dd964e0d1a323e8db6f0088d (patch)
tree7f4a81dea268520fa3ab828a00910565016a229f /gcc/java
parent51c9fed94b1c54202ddc481b3f4fe752989799a7 (diff)
downloadgcc-fd5f23d3a60e9271dd964e0d1a323e8db6f0088d.zip
gcc-fd5f23d3a60e9271dd964e0d1a323e8db6f0088d.tar.gz
gcc-fd5f23d3a60e9271dd964e0d1a323e8db6f0088d.tar.bz2
re PR java/17329 (ICE: SEGV in java_gimplify_expr)
PR java/17329: * java-gimplify.c (java_gimplify_expr) <SAVE_EXPR>: Ignore case where operand is null. From-SVN: r87961
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/java-gimplify.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index e172f97..e75ebd0 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,11 @@
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:
* parse.y (not_accessible_p): Allow access to protected members
even when class is not static.
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 54d5c75..664eb9a 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -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);