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:14:04 UTC 2024
On Mon, 13 May 2024 17:22:07 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 247:
>
>> 245: case DeprecatedAttribute da -> 0;
>> 246: case EnclosingMethodAttribute ema -> 4;
>> 247: case ExceptionsAttribute ea -> 2 + 2 * ea.exceptions().size();
>
> See 4.7.5:
>> Each value in the exception_index_table array must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Class_info structure ([§4.4.1](https://docs.oracle.com/javase/specs/jvms/se22/html/jvms-4.html#jvms-4.4.1)) representing a class type that this method is declared to throw.
CP entries are verified by inflation in the `ea.exceptions()` call.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16809#discussion_r1599832116
More information about the core-libs-dev
mailing list