On Wed, 25 Mar 2026 14:10:55 GMT, Stefan Karlsson <[email protected]> wrote:

> These functions cast oops to arrayOop without first checking that the `obj` 
> argument is an array. It turns out that TestIntrinsics.java sends in 
> non-array objects.
> 
> I found this when I worked on something else and changed 
> `obj->is_null_free_array()` to `obj->klass()->is_null_free_array_klass()`, 
> and the latter asserted because `obj` was a String and not an array.
> 
> Edit: I've now reworked the patch so that the Java APIs now only accept 
> Object[] arrays and then put in asserts in the code that check that this is 
> the case. I've also removed the parts of the tests that passes in Strings and 
> int arrays.

This pull request has now been integrated.

Changeset: c089179b
Author:    Stefan Karlsson <[email protected]>
URL:       
https://git.openjdk.org/valhalla/commit/c089179bf47d4d6474413e4da25de121036b67f8
Stats:     87 lines in 9 files changed: 21 ins; 12 del; 54 mod

8380902: [lworld] Type confusion in jvm.cpp functions

Reviewed-by: dholmes, fparain

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

PR: https://git.openjdk.org/valhalla/pull/2261

Reply via email to