This discussion is archived
1 Reply Latest reply: Jul 5, 2010 3:15 AM by 791266 RSS

Bytecode problem

843798 Newbie
Currently Being Moderated
Hi all,

I have following piecse of byte code which is not running:

0 bipush 0
2 anewarray #4 <java/lang/Object>
5 astore 1
7 sipush 1
10 aload_0
11 aload 1
13 invokestatic #30 <com/test/AClass.aMethod>
16 pop
17 return

The source declaration of the called method aMethod is:

public static Object aMethod(int a, Object b, Object[] c)
{
.........
}

The constructor you see the byte code here:

public SuperCrazyClass()
{
.........
}

When i try to execute the Constructor i get following error printed in console:

Exception in thread "main" java.lang.VerifyError: (class: SuperCrazyClass, method: <init> signature: ()V) Expecting to find object/array on stack

As you know <init> is the internal name of all constructors, together with the signature you can see that error must be located inside the bytecode snippet above. That byte code snippet is generate by custom binary instrumentation framework i wrote and it works for a lot of different methods but in that case, and i really don't know what is wrong with it, it doesn't.

Any idea what I'm doing wrong ?

Regards,
bgnahm

PS: I previously posted also in the Hotspot Forum, but i think this question fits better here...sorry for that
  • 1. Re: Bytecode problem
    791266 Explorer
    Currently Being Moderated
    bgnahm wrote:
    PS: I previously posted also in the Hotspot Forum, but i think this question fits better here...sorry for that
    No, the other forum is at least more related to the class format. I'm locking this thread. People who are reading this can still answer the original thread at:

    [http://forums.sun.com/thread.jspa?threadID=5443852]

    Kaj