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

Chen Liang liach at openjdk.org
Wed May 15 11:39:06 UTC 2024


On Wed, 15 May 2024 10:47:23 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> ClassFile API `jdk.internal.classfile.verifier.VerifierImpl` performed only bytecode-level class verification.
>> This patch adds `jdk.internal.classfile.verifier.ParserVerifier` with additional class checks inspired by `hotspot/share/classfile/classFileParser.cpp`.
>> 
>> Also new `VerifierSelfTest::testParserVerifier` has been added.
>> 
>> Please review.
>> 
>> Thanks,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   applied the suggested changes

src/java.base/share/classes/jdk/internal/classfile/impl/verifier/ParserVerifier.java line 308:

> 306:                 0;
> 307:             default ->
> 308:                 -1;

I recommend we explicitly return -1 to skip verification only for UnknownAttribute and CustomAttribute; then our tests can catch missing verification for new attribute additions.

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

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


More information about the compiler-dev mailing list