> Hello, > > This PR fixes an issue in `JVM_IHashCode` where we don't handle an exception > occurring in the Java call to `ValueObjectMethods.valueObjectHashCode`. If an > exception is thrown, we still proceed to install the (bad) hashcode that is > based on a return value which is garbage data. > > To fix this, we should make sure to return if there is a pending exception. > > @xmas92 came up with a smart approach to encapsulate the behavior of wrapping > an exception in an internal error into a separate helper, which is > implemented in this PR as well. I've adapted other similar places where we > wrap exceptions like this as well. These use-cases are all Valhalla-specific, > so makes sense to change here IMO. > > Testing: > * Running Oracle's tier1-4 > * Test reproducer that fails before (installing a bad hashcode), and succeeds > with the changes in this PR (never installs a bad hashcode). > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
Joel Sikström has updated the pull request incrementally with one additional commit since the last revision: Add @requires vm.flagless to new test ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/2410/files - new: https://git.openjdk.org/valhalla/pull/2410/files/5c8d378a..28deb7a0 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2410&range=03 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2410&range=02-03 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/valhalla/pull/2410.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2410/head:pull/2410 PR: https://git.openjdk.org/valhalla/pull/2410
