RFR: 8364588: Export the NPE backtracking functionality to general null-checking APIs [v4]
David Holmes
dholmes at openjdk.org
Tue Sep 23 22:46:12 UTC 2025
On Tue, 5 Aug 2025 16:04:08 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Provide a general facility for our null check APIs like Objects::requireNonNull or future Checks::nullCheck (void), converting the existing infrastructure to start tracking from a given stack site (depth offset) and a given stack slot (offset value).
>>
>> This is a necessary prerequisite for https://bugs.openjdk.org/browse/JDK-8233268, which proposes enhanced null messages to `Objects::requireNonNull`.
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>
> Update NPE per roger review
src/hotspot/share/interpreter/bytecodeUtils.cpp line 205:
> 203: // A slot is found
> 204: FOUND
> 205: };
So you define an ENUM to capture the negative cases but then you can use any int >= 0 and pretend it is a member of the enum. ?? Is that typical C++ enum usage?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26600#discussion_r2373618080
More information about the security-dev
mailing list