RFR: 8322282: Incorrect LoaderConstraintTable::add_entry after JDK-8298468

Aleksey Shipilev shade at openjdk.org
Mon Dec 18 12:48:39 UTC 2023


On Mon, 18 Dec 2023 12:21:00 GMT, David Holmes <dholmes at openjdk.org> wrote:

> I will need to check with the original fix

Look at the change that introduced it: https://github.com/openjdk/jdk/commit/10737e168c967a08e257927251861bf2c14795ab?diff=unified&w=0#diff-49d18b7f77db80ff67872c7db1e4c87e98a126e63fff5f63353e4406db332b19R340-R344

...it looks like a typo, isn't it? The logic for that code is also understandable: if one `LoaderConstraint` is `nullptr`, we merge into another one.

> I and I still can't see any way that this leads to the NPE that was reported.

I see compiler looks up classes from `LoaderConstraintTable` sometimes: `ciEnv::get_klass_by_name_impl` -> `SystemDictionary::find_constrained_instance_or_array_klass`. So it makes some sense to me that if we are reporting wrong result to compiler, it would then foobar the generated code by assuming something about the class that is not true.

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

PR Comment: https://git.openjdk.org/jdk/pull/17140#issuecomment-1860406144


More information about the hotspot-runtime-dev mailing list