On Mon, 30 Mar 2026 09:04:11 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.
>
> Stefan Karlsson has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains three additional 
> commits since the last revision:
> 
>  - Merge remote-tracking branch 'valhalla/lworld' into 
> 8380902_lworld_type_confusion_in_jvm_cpp
>  - Change the functions to take an Object[] as the argument
>  - 8380902: [lworld] Type confusion in jvm.cpp functions

It would be nice to get a closure w.r.t. this PR. @fparain Does this look OK to 
you? I did some spot performance testing with 
`test/micro/org/openjdk/bench/valhalla/array` micros and couldn't see a 
difference.

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

PR Comment: https://git.openjdk.org/valhalla/pull/2261#issuecomment-4154386399

Reply via email to