From 5b84be73837bd61dc88a7a76fd68f90440dc2e49 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 11 Nov 2003 20:20:07 +0000 Subject: [PATCH] re PR java/12915 (Broken String concatenation) PR java/12915: * parse.y (merge_string_cste): Handle case where we have a pointer that happens to be zero, not null_pointer_node. From-SVN: r73461 --- gcc/java/ChangeLog | 6 ++++++ gcc/java/parse.y | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 19beaaa..e999ddb 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +2003-11-11 Tom Tromey + + PR java/12915: + * parse.y (merge_string_cste): Handle case where we have a + pointer that happens to be zero, not null_pointer_node. + 2003-11-10 Tom Tromey * jcf-parse.c (classify_zip_file): Correctly compare diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 448e0c8..fc4963d 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -13841,7 +13841,9 @@ merge_string_cste (tree op1, tree op2, int after) string = boolean_true; else if (op2 == boolean_false_node) string = boolean_false; - else if (op2 == null_pointer_node) + else if (op2 == null_pointer_node + || (integer_zerop (op2) + && TREE_CODE (TREE_TYPE (op2)) == POINTER_TYPE)) /* FIXME: null is not a compile-time constant, so it is only safe to merge if the overall expression is non-constant. However, this code always merges without checking the overall expression. */ -- 2.7.4