On Thu, 1 Jul 2021 17:33:02 GMT, Coleen Phillimore <[email protected]> wrote:
>> src/hotspot/share/compiler/compileBroker.cpp line 909:
>>
>>> 907: // JavaThread due to lack of resources. We will handle that failure
>>> below.
>>> 908:
>>> 909: if (new_thread->osthread() != NULL) {
>>
>> I think you do need to check `new_thread != NULL` here to please Parfait for
>> `default:` case.
>
> Really? We have this sort of code everywhere. We don't check the result of
> a new expression anywhere else.
It isn't the result of the new expression that needs checking. The switch
statement has a default: clause which calls ShouldNotReachHere(). IIRC Parfait
does not understand things like ShouldNotReachHere() never return, and so it
thinks "new_thread" may still be NULL if we followed the default: path through
the switch.
I will restore this NULL check with a comment.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4629