RFR: 8366498: Wrong InstanceKlass::cast() in ClassFileParser::parse_super_class

David Holmes dholmes at openjdk.org
Mon Sep 1 06:29:41 UTC 2025


On Mon, 1 Sep 2025 05:19:43 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Please review this small change. 
> 
> It affects debug build only, and I am not even sure if `cp->resolved_klass_at()` is ever called. Since we are very early in class file parsing, it's unlikely that any klass entries have been resolved at this point.
> 
> Anyway, for correctness, the `InstanceKlass::cast()` should be done after the check for array class.

This does correct the cast but as you suggest this code should actually be unreachable - `is_klass()` will fail as no classes have been resolved at this stage of classfile parsing,

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

PR Review: https://git.openjdk.org/jdk/pull/27026#pullrequestreview-3172246976


More information about the hotspot-runtime-dev mailing list