On Mon, 10 Aug 2026 09:04:42 GMT, Timofei <[email protected]> wrote: >> FollowReferences function has unreachable code. The null check was >> incorrectly applied to the klass variable inside a block where klass is >> already guaranteed to be non-null. Because of this, the check was always >> false, and the extracted internal Klass* pointer (k) was left unchecked, >> which could lead to a null pointer dereference. >> >> Fix the typo by changing klass to k in the null check. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Timofei has updated the pull request incrementally with two additional > commits since the last revision: > > - Add regression test for FollowReferences > - Delete unreachable code
So you are saying that `java_lang_Class::as_Klass(k_mirror)` can never evaluate to nullptr because `k_mirror` is not null and it does not represent a primitive type, therefore it must be a non-null klass type. That sounds reasonable, but I think we should assert that. The PR description then needs to be updated to reflect the actual change. I don't see the relevance of the regression test though. ------------- PR Comment: https://git.openjdk.org/jdk/pull/32253#issuecomment-5287210613
