PR java/19070: Don't allow null v/s number comparisons

Ranjit Mathew rmathew@gmail.com
Tue Jan 18 13:35:00 GMT 2005


Hi,

  The following simple patch converts the ICE in PR 19070
into the syntax error that should have been shown.

GCJ currently allows this to pass:

  ...
  double snafu = 0.0;
  if (snafu != null)
  ...

The existing code used to allow a comparison to
pass if either operand is a NULL, when the right
thing in this case would be to allow it only if either 
both are NULL or one is a NULL and the other is 
a reference.

Tested on i686-pc-linux-gnu with Jacks included.
Causes no new failures but 8 XPASSes in Jacks.

OK for mainline?

Thanks,
Ranjit.

-- 
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://ranjitmathew.hostingzero.com/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PR19070.txt
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20050118/2e8bd765/attachment.txt>


More information about the Java-patches mailing list