summaryrefslogtreecommitdiffstats
path: root/gcc/java
diff options
context:
space:
mode:
authorrmathew <rmathew@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-25 06:12:32 +0000
committerrmathew <rmathew@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-25 06:12:32 +0000
commit3579574a27d67bbe1342406b7df6c659ffd04e8a (patch)
tree8a8404a8bdd64dda815edafed61709a9a62388f1 /gcc/java
parent98cb1dca2a2a209356f9f6056c3818abe78bbe15 (diff)
downloadppe42-gcc-3579574a27d67bbe1342406b7df6c659ffd04e8a.tar.gz
ppe42-gcc-3579574a27d67bbe1342406b7df6c659ffd04e8a.zip
PR java/19070
* parse.y (patch_binop): Allow comparisons against NULL only if the other operand is of a reference type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94205 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/parse.y6
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 116df16036d..ee418645219 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-18 Ranjit Mathew <rmathew@hotmail.com>
+
+ PR java/19070
+ * parse.y (patch_binop): Allow comparisons against NULL only
+ if the other operand is of a reference type.
+
2005-01-24 Tom Tromey <tromey@redhat.com>
* java-tree.h (gcj_abi_version): Declare.
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index b09bb875157..1c3eb92b1eb 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -1,6 +1,6 @@
/* Source code parsing and tree node generation for the GNU compiler
for the Java(TM) language.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
@@ -13798,7 +13798,9 @@ patch_binop (tree node, tree wfl_op1, tree wfl_op2)
/* Types have to be either references or the null type. If
they're references, it must be possible to convert either
type to the other by casting conversion. */
- else if (op1 == null_pointer_node || op2 == null_pointer_node
+ else if ((op1 == null_pointer_node && op2 == null_pointer_node)
+ || (op1 == null_pointer_node && JREFERENCE_TYPE_P (op2_type))
+ || (JREFERENCE_TYPE_P (op1_type) && op2 == null_pointer_node)
|| (JREFERENCE_TYPE_P (op1_type) && JREFERENCE_TYPE_P (op2_type)
&& (valid_ref_assignconv_cast_p (op1_type, op2_type, 1)
|| valid_ref_assignconv_cast_p (op2_type,
OpenPOWER on IntegriCloud