Re: Re: Re: A complete list of JDK classes which CheckClassAdapter fails (bug?)

Rémi Forax <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
Le 20/08/2010 20:53, [email protected] a écrit :
>>   Section 4.11.1.2 of the updated class file format for Java 1.6
>> describes subtype matching for the bytecode verifier, but it is using
>> Prolog notation and rather hard to interpret. You can take a look here
>>   https://docs.google.com/fileview?id=0B56Yc_XO11-dYTM2NzhiYjUtYjZkMC00YjZiLTg5ZTYtOTgwMjM4NDI2ZjEz
>>      
> the Prolog rules are only for StackMapTable attributes, with type checking. Anyway, p 181 of your reference, it is said that "interfaces are treated like Object".
>
> Concerning pre Java 5 classes, with type inference, it is said, p 267 of your reference:
> "The types of values on the stacks must also be identical, except that differently typed reference values may appear at corresponding places on the two stacks. In this case, the merged operand stack contains a reference to an instance of the first common superclass of the two types. Such a reference type always exists because the type Object is a superclass of all class and interface types. If the operand stacks cannot be merged, verification of the method fails"
>
> So, as I said, there are not any rule in the JVM specification to compute such a common super interface type when merging stack frames. This is understandable, because "the" common super interface of two interface types may not be unique (due to multiple inheritance of interfaces). Hence you cannot choose one merged type, and you have to handle sets of possible types for each stack map frame slot. See section 7 of this paper:
>
> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.804
>
> (they show similar programs as my previous example, which should not pass verification according to the JVMS, but which are accepted by Sun's verifier). At the end, I would say that the "bug" in CheckClassAdapter is more a "bug" in the JDK classes and/or verifier, which does not strictly follow the JVMS.
>
> Eric
>    

Eric,
Why don't modify CheckClassAdapter to handle join interfaces as 
suggested in the paper you reference ?

Rémi
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.