RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]
Daniel D.Daugherty
dcubed at openjdk.java.net
Mon Jun 6 20:37:22 UTC 2022
On Mon, 6 Jun 2022 07:20:10 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> src/hotspot/share/prims/jvmtiEventController.cpp line 370:
>>
>>> 368: }
>>> 369: EnterInterpOnlyModeClosure hs;
>>> 370: assert(state->get_thread() != NULL, "sanity check");
>>
>> Existing: We have already performed this check. We set `target` above and returned if it was `NULL`.
>
> We also no longer need L358 as `current` is now unused.
JavaThread *target = state->get_thread();
Thread *current = Thread::current();
assert(state != NULL, "sanity check");
The `assert()` on L360 is in the wrong place. If `state == NULL`, we would
have crashed on L357 before we got to the assert(). This bug is pre-existing
and not due to this PR.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8992
More information about the serviceability-dev
mailing list