On Thu, 26 Mar 2026 21:08:34 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.
>
> Stefan Karlsson has updated the pull request incrementally with one
> additional commit since the last revision:
>
> Change the functions to take an Object[] as the argument
src/java.base/share/classes/java/lang/invoke/ArrayVarHandle.java line 123:
> 121: Object[] array = (Object[]) handle.arrayType.cast(oarray);
> 122: Class<?> arrayType = oarray.getClass();
> 123: if (ValueClass.isFlatArray(array)) {
I'd like to get extra scrutiny of this change.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2261#discussion_r2997676959