java/1127: gcj accepts invalid code where an exception must be caught/thrown

bryce@albatross.co.nz bryce@albatross.co.nz
Wed Dec 20 12:07:00 GMT 2000


>Number:         1127
>Category:       java
>Synopsis:       gcj accepts invalid code where an exception must be caught/thrown
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:06:21 PST 2000
>Closed-Date:    Thu Jul 22 11:05:30 PDT 1999
>Last-Modified:  Thu Jul 22 11:05:30 PDT 1999
>Originator:     Bryce McKinlay
>Release:        gcc version gcc-2.96 19990630 (experimental)
>Organization:
>Environment:
Any
>Description:
This is a source parser bug.

gcj can fail to report an "exception must be caught or 
thrown" error depending on how the method that throws the
exception is invoked.
>How-To-Repeat:
The following code demonstrates the problem:

public class MustCatchOrThrow
{
  public static void main(String args[])
  {    
    new MustCatchOrThrow().test();    
  }
    
  private void test() throws Exception
  {
    throw new Exception();
  }
}

If the test method is invoked as follows, gcj correctly
reports an error:

MustCatchOrThrow m = new MustCatchOrThrow();
m.test(); 
>Fix:
http://egcs.cygnus.com/ml/gcc-patches/1999-07/msg00525.html
>Release-Note:
Libgcj's java/net should be updated in order to compile
with the patches compiler. See
http://sourceware.cygnus.com/ml/java-patches/1999-q3/msg00048.html
>Audit-Trail:

Formerly PR gcj/12

State-Changed-From-To: open->feedback
State-Changed-By: apbianco
State-Changed-When: Tue Jul 20 14:09:36 1999
State-Changed-Why:
Temptative fix checked in egcs. Let me know how it works
for you.
State-Changed-From-To: feedback->closed
State-Changed-By: apbianco
State-Changed-When: Thu Jul 22 11:05:30 1999
State-Changed-Why:
Bryce's and Alex's tests reported the patch was adequate.
>Unformatted:




More information about the Gcc-prs mailing list