On Thu, 7 May 2026 14:34:25 GMT, Joel Sikström <[email protected]> wrote:
> 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). This pull request has now been integrated. Changeset: 9a8e8229 Author: Joel Sikström <[email protected]> URL: https://git.openjdk.org/valhalla/commit/9a8e82297fd5d35cddfa19c132fea92c33e5dafb Stats: 110 lines in 6 files changed: 83 ins; 21 del; 6 mod 8384081: [lworld] JVM_IHashCode caches hash after pending exception Co-authored-by: Axel Boldt-Christmas <[email protected]> Co-authored-by: Paul Hübner <[email protected]> Reviewed-by: aboldtch, dholmes ------------- PR: https://git.openjdk.org/valhalla/pull/2410
