Index: ChangeLog =================================================================== --- ChangeLog 2005-01-18 17:53:46.000000000 +0530 +++ ChangeLog 2005-01-18 19:02:21.000000000 +0530 @@ -1,2 +1,8 @@ +2005-01-18 Ranjit Mathew + + PR java/19070 + * parse.y (patch_binop): Allow comparisons against NULL only + if the other operand is of a reference type. + 2005-01-17 Tom Tromey Index: parse.y =================================================================== --- parse.y 2005-01-18 17:48:39.000000000 +0530 +++ parse.y 2005-01-18 18:17:16.000000000 +0530 @@ -1,5 +1,5 @@ /* 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) @@ -13799,5 +13799,7 @@ patch_binop (tree node, tree wfl_op1, tr 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)