Bug 18682 - gcj doesnt reject invalid code
Summary: gcj doesnt reject invalid code
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2004-11-26 17:12 UTC by Michael Koch
Modified: 2005-02-02 13:08 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail: 3.3.4 3.4.2 4.0.0 3.0.4 3.2.2
Last reconfirmed: 2004-11-26 17:13:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Koch 2004-11-26 17:12:37 UTC
GCJ does not reject the following invalid code: 
 
public class NullTest 
{ 
  public static void main (String[] args) 
  { 
    int index = 1; 
    if (index == null) 
      index++; 
  } 
}
Comment 1 Andrew Pinski 2004-11-26 17:46:29 UTC
Hmm interesting we even produce valid bytecode with the source, maybe we are converting into the 
correct type which is why this is accepted.
Comment 2 Ranjit Mathew 2005-02-02 13:08:36 UTC
Fixed by my patch for PR java/19070