public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/18430] New: VerifyError, incompatible type on stack
@ 2004-11-11 16:32 brian_252 at yahoo dot com
  2004-11-11 16:34 ` [Bug libgcj/18430] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: brian_252 at yahoo dot com @ 2004-11-11 16:32 UTC (permalink / raw)
  To: java-prs

I'm trying to compile Ant and i ran into and error.  I simplified the code as 
much as possible while still producing the error.  It doesn't matter if you 
use gcj or Sun's javac (1.3.1) to compile.  And Sun's java will run the code 
without problem. 
 
Here's the code: 
interface fnm 
 { 
 int getInt(); 
 } 
 
class im1  
implements fnm 
 { 
 public int getInt() { return 1; } 
 } 
 
class im2 
implements fnm 
 { 
 public int getInt() { return 2; } 
 } 
 
public class test 
 { 
 public static void main( String[] Args ) 
  { 
  test T = new test(); 
  T.exec(); 
  } 
 
 public void exec() 
  { 
  fnm myMapper = new im1(); 
  if (Math.random() == 1.0d) 
   { 
   myMapper = new im2(); 
   } 
  System.out.println( myMapper.getClass().getName() ); // im1 
 // System.out.println( myMapper.getInt() ); // works 
 // this.select( myMapper );   // fails 
  } 
 
 public void select( fnm Mapper ) 
  { 
  System.out.println( Mapper.getInt() ); 
  } 
 } 
 
 
Here's the stack trace: 
Exception in thread "main" java.lang.VerifyError: verification failed at PC 26 
in test:exec(()V): incompatible type on stack 
   at _Jv_BytecodeVerifier.verify_fail(byte, int) (/usr/lib/libgcj.so.4.0.0) 
   at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.4.0.0) 
   at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.4.0.0) 
   at _Jv_PrepareClass(java.lang.Class) (/usr/lib/libgcj.so.4.0.0) 
   at java.lang.ClassLoader.linkClass0(java.lang.Class) 
(/usr/lib/libgcj.so.4.0.0) 
   at java.lang.ClassLoader.resolveClass0(java.lang.Class) 
(/usr/lib/libgcj.so.4.0.0) 
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.4.0.0) 
   at java.lang.Class.forName(java.lang.String, boolean, 
java.lang.ClassLoader) (/usr/lib/libgcj.so.4.0.0) 
   at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.4.0.0) 
   at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.4.0.0) 
   at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.4.0.0) 
   at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) 
(/usr/lib/libgcj.so.4.0.0) 
   at __libc_start_main (/lib/libc-2.3.2.so)

-- 
           Summary: VerifyError, incompatible type on stack
           Product: gcc
           Version: 3.3.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: brian_252 at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18430


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-11-11 16:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-11 16:32 [Bug java/18430] New: VerifyError, incompatible type on stack brian_252 at yahoo dot com
2004-11-11 16:34 ` [Bug libgcj/18430] " pinskia at gcc dot gnu dot org
2004-11-11 16:36 ` brian_252 at yahoo dot com
2004-11-11 16:37 ` brian_252 at yahoo dot com
2004-11-11 16:40 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).