AnalyzerAdapter: computed stack incorrect after super-constructor call?

Andreas Sewe <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Organization Software Technology Group, Technisch e Universität Darmstadt
Message-ID <[email protected]>
Hi all,

when working with the AnalyzerAdapter I have encountered a weird 
situation, in which I am not sure whether the AnalyzerAdapter's stack 
computations are incorrect or whether I just misunderstand the 
"Verification or class files" section the JVM spec. (Probably the 
latter, as my Prolog is a little bit rusty.)

So here is the code that puzzles me, interspersed with the stack 
according to the AnalyzerApadater. Its a simple constructor of a class 
Foo, whose immediate superclass is Object:

  Foo."<init>":()V:
    []
    aload_0
    [UNINITIALZED_THIS]
    invokespecial java/lang/Object."<init>":()V
    []
    aload_0
    [java/lang/Object]
    bipush 42
    [java/lang/Object, INTEGER]
    putfield Foo.bar:I
    []
    return
    []

What I don't get is why the second aload_0 pushes an Object rather than 
a Foo and how on earth the putfield then passes verification. As far as 
I understand the JVM spec, there is no special treatment of putfield in 
constructors that would explain this.

Can somebody shed some light on this situation?

Best wishes,

Andreas Sewe
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.