RFR: 8313874 - JNI NewWeakGlobalRef throws exception for null arg [v2]
Oli Gillespie
ogillespie at openjdk.org
Tue Aug 8 13:20:55 UTC 2023
> According to the JNI spec for NewWeakGlobalRef:
>
>> Returns NULL if obj refers to null, or if obj was a weak global reference, or if the VM runs out of memory. If the VM runs out of memory, an OutOfMemoryError will be thrown.
>
> The current behaviour is that `NewWeakGlobalRef(nullptr)` throws an OutOfMemoryError, which it should not.
>
> (Thanks @dholmes-ora for confirming the issue and suggesting a fix.)
Oli Gillespie has updated the pull request incrementally with one additional commit since the last revision:
Review feedback
Move test case to existing test, use .not_null() for null check.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/15188/files
- new: https://git.openjdk.org/jdk/pull/15188/files/87ab7c9e..69ab3c4b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=15188&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=15188&range=00-01
Stats: 52 lines in 4 files changed: 10 ins; 41 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/15188.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/15188/head:pull/15188
PR: https://git.openjdk.org/jdk/pull/15188
More information about the hotspot-dev
mailing list