java/5537: Error compiling simple bytecode with jsr

Daniel.Bonniot@inria.fr Daniel.Bonniot@inria.fr
Wed Jan 30 04:26:00 GMT 2002


>Number:         5537
>Category:       java
>Synopsis:       Error compiling simple bytecode with jsr
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 30 04:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Daniel Bonniot
>Release:        3.0.3
>Organization:
>Environment:
Debian package gcj-3.0
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.0.3
>Description:
This case involves calling return in a try/finally block,
and compiling from bytecode.

public class A 
{
  public static void main(String[] args)
  {
    try{
      return;
    }
    finally{
    }
  }
}

gcj compiles correctly from source, but fails on the corresponding
bytecode (attached):
$ gcj A.class
A.java: In class `A':
A.java: In method `A.main(java.lang.String[])':
A.java:6: verification error at PC=8
A.java:6: loading local variable 1 which has unknown type

$ javap -c A.class
Compiled from A.java
public class A extends java.lang.Object {
    public A();
    public static void main(java.lang.String[]);
}

Method A()
   0 aload_0
   1 invokespecial #1 <Method java.lang.Object()>
   4 return

Method void main(java.lang.String[])
   0 jsr 10
   3 return
   4 astore_1
   5 jsr 10
   8 aload_1
   9 athrow
  10 astore_2
  11 ret 2
Exception table:
   from   to  target type
     0     4     4   any
>How-To-Repeat:
gcj A.class
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-java-vm; name="A.class"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="A.class"

yv66vgADAC0ADwoAAwAMBwANBwAOAQAGPGluaXQ+AQADKClWAQAEQ29kZQEAD0xpbmVOdW1iZXJU
YWJsZQEABG1haW4BABYoW0xqYXZhL2xhbmcvU3RyaW5nOylWAQAKU291cmNlRmlsZQEABkEuamF2
YQwABAAFAQABQQEAEGphdmEvbGFuZy9PYmplY3QAIQACAAMAAAAAAAIAAQAEAAUAAQAGAAAAHQAB
AAEAAAAFKrcAAbEAAAABAAcAAAAGAAEAAAABAAkACAAJAAEABgAAADEAAQADAAAADagACrFMqAAF
K79NqQIAAQAAAAQABAAAAAEABwAAAAoAAgAAAAYABAAIAAEACgAAAAIACw==



More information about the Java-prs mailing list