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

Chen Liang liach at openjdk.org
Mon May 13 17:38:11 UTC 2024


On Thu, 9 May 2024 10:11:22 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 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 233:

> 231:                 ClassDesc type = ((FieldModel)ae).fieldTypeSymbol();
> 232:                 ConstantValueEntry cve = cva.constant();
> 233:                 if (!switch (TypeKind.from(type)) {

Weird-looking switch

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

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


More information about the core-libs-dev mailing list