> 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 four additional 
commits since the last revision:

 - Merge remote-tracking branch 'valhalla/lworld' into 
8380902_lworld_type_confusion_in_jvm_cpp
 - 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

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/2261/files
  - new: https://git.openjdk.org/valhalla/pull/2261/files/27d86f50..c9d1090f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2261&range=03
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2261&range=02-03

  Stats: 121 lines in 13 files changed: 74 ins; 20 del; 27 mod
  Patch: https://git.openjdk.org/valhalla/pull/2261.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2261/head:pull/2261

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

Reply via email to