> Hi everyone, > > One of the `FlatFieldPayload` constructors uses `container->klass()` when > calling `inline_layout_info_adr`, even though the layout should be resolved > from `field_holder()`. When JNI `GetObjectField` or `SetObjectField` accesses > an inherited flat field on a derived class it ends up looking up inline > layout info from the that class instead of the class that actually declares > the field. In debug builds this triggers an assert, and in general it is the > wrong class to use for the lookup. > > This path is only reached through JNI field access. The original fix is from > @stefank. I added a regression test that tests JNI reads and writes of > inherited flat fields and checks that the inherited base field is resolved > correctly. The new test hits the assert before the fix and passes with the > patch applied. > > Testing: > - Tier 1 > - New test testing modifying inherited flat fields through JNI > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
Casper Norrbin has updated the pull request incrementally with one additional commit since the last revision: feedback fixes ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/2355/files - new: https://git.openjdk.org/valhalla/pull/2355/files/c62454e1..17bf5d7d Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2355&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2355&range=00-01 Stats: 16 lines in 2 files changed: 4 ins; 11 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/2355.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2355/head:pull/2355 PR: https://git.openjdk.org/valhalla/pull/2355
