aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorRanjit Mathew <rmathew@hotmail.com>2005-02-01 02:36:29 +0000
committerRanjit Mathew <rmathew@gcc.gnu.org>2005-02-01 02:36:29 +0000
commit7f75bb83182ad56c111263bc484ef4a65bd42d67 (patch)
treea7997918aeee27c475e3c6565aa970bd1c3e1e19 /gcc/java
parent9367851362e79e5854b56c8ad153d4b3c9d9a264 (diff)
downloadgcc-7f75bb83182ad56c111263bc484ef4a65bd42d67.zip
gcc-7f75bb83182ad56c111263bc484ef4a65bd42d67.tar.gz
gcc-7f75bb83182ad56c111263bc484ef4a65bd42d67.tar.bz2
re PR java/9157 (SEGV on bad java source)
PR java/9157 * parse.y (build_string_concatenation): Remove redundant if. (patch_conditional_expr): Attempt to patch_string() the condition of a ?: as well, in addition to its other operands. From-SVN: r94513
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog7
-rw-r--r--gcc/java/parse.y9
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b3b125f..9126d9d 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,10 @@
+2005-02-01 Ranjit Mathew <rmathew@hotmail.com>
+
+ PR java/9157
+ * parse.y (build_string_concatenation): Remove redundant if.
+ (patch_conditional_expr): Attempt to patch_string() the condition
+ of a ?: as well, in addition to its other operands.
+
2005-01-25 Tom Tromey <tromey@redhat.com>
* Make-lang.in (java/java-tree-inline.o): Removed.
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 1c3eb92..cc30c8e 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -14032,8 +14032,7 @@ build_string_concatenation (tree op1, tree op2)
/* OP1 is no longer the last node holding a crafted StringBuffer */
IS_CRAFTED_STRING_BUFFER_P (op1) = 0;
/* Create a node for `{new...,xxx}.append (op2)' */
- if (op2)
- op1 = make_qualified_primary (op1, BUILD_APPEND (op2), 0);
+ op1 = make_qualified_primary (op1, BUILD_APPEND (op2), 0);
}
/* Mark the last node holding a crafted StringBuffer */
@@ -16047,8 +16046,10 @@ patch_conditional_expr (tree node, tree wfl_cond, tree wfl_op1)
tree t1, t2, patched;
int error_found = 0;
- /* Operands of ?: might be StringBuffers crafted as a result of a
- string concatenation. Obtain a descent operand here. */
+ /* The condition and operands of ?: might be StringBuffers crafted
+ as a result of a string concatenation. Obtain decent ones here. */
+ if ((patched = patch_string (cond)))
+ TREE_OPERAND (node, 0) = cond = patched;
if ((patched = patch_string (op1)))
TREE_OPERAND (node, 1) = op1 = patched;
if ((patched = patch_string (op2)))