[kaffe] Bytecode fails verification when anonymous class inherits inner class of another class.

Ito Kazumitsu ito.kazumitsu at hidec.co.jp
Mon Jan 17 03:41:17 PST 2005


In message "[kaffe] Bytecode fails verification when anonymous class inherits inner class of another class."
    on 05/01/16, Kalle Olavi Niemitalo <kon at iki.fi> writes:

> The resulting Second$1Inner.class contains this method:
> 
> Method name:"<init>" public Signature: (Second,First)void
> Attribute "Code", length:38, max_stack:2, max_locals:3, code_length:14
>   0: aload_0
>   1: aload_2
>   2: getfield <Field First$Inner.this$0 First>
>   5: invokespecial <Method First$Inner.<init> (First)void>
>   8: aload_0
>   9: aload_1
>  10: putfield <Field Second$1Inner.this$0 Second>
>  13: return
> Attribute "LineNumberTable", length:6, count: 1
>   line: 7 at pc: 0
> Attribute "Signature", length:2
> 
> The getfield instruction at PC=2 is incorrect, as shown by GCC:

I have found that this getfield is written at line 439 of
kjc/bytecode/classfile/ClassInfo.java.

   436      // methods
   437      out.writeShort(methods.length);
   438      for (int i = 0; i < methods.length; i++) {
   439        methods[i].write(constantPool, out);       <-- HERE
   440      }




More information about the kaffe mailing list