On Thu, 9 May 2024 10:11:22 GMT, Adam Sotona <[email protected]> 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 223:
> 221: errors.add(new VerifyError("Arguments can't fit into
> locals in %s".formatted(toString(ae))));
> 222: }
> 223: int l = 12 + ca.codeLength() + 8 *
> ca.exceptionHandlers().size();
nit (or not): it would be amazing if all these constants have a name. They are
almost intuitive, I admit, but it would improve readability a lot.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16809#discussion_r1599604770