RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp [v5]

Adam Sotona asotona at openjdk.org
Tue May 14 11:11:03 UTC 2024


On Mon, 13 May 2024 17:21:03 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - fixed error thrown by VerifierImpl
>>  - applied suggested changes
>
> src/java.base/share/classes/jdk/internal/classfile/impl/verifier/ParserVerifier.java line 246:
> 
>> 244:             }
>> 245:             case DeprecatedAttribute da -> 0;
>> 246:             case EnclosingMethodAttribute ema -> 4;
> 
> See 4.7.7:
>> Otherwise, the value of the method_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_NameAndType_info structure ([§4.4.6](https://docs.oracle.com/javase/specs/jvms/se22/html/jvms-4.html#jvms-4.4.6)) representing the name and type of a method in the class referenced by the class_index attribute above.

Yes, I'll inflate CP entries referenced from the attributes, that will do the verification.
Thanks.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16809#discussion_r1599828385


More information about the compiler-dev mailing list