RFR: 8356778: Compiler add event logging in case of failures
Martin Doerr
mdoerr at openjdk.org
Thu May 15 16:06:53 UTC 2025
On Thu, 15 May 2025 15:53:19 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:
>> src/hotspot/share/c1/c1_Compilation.cpp line 651:
>>
>>> 649: assert(msg != nullptr, "bailout message must exist");
>>> 650: // record the bailout for hserr envlog
>>> 651: if (msg != nullptr) {
>>
>> How can it be nullptr? All callers pass some message.
>
> What if I create a new call like
>
> char* myMsg = nullptr;
> . . .
> bailout(myMsg);
>
> and, due to complicated logic, `myMsg` is not assigned a value in all cases? General topic: future-proof code.
I could live with the check, but we get other problems when it is nullptr because nullptr is interpreted as no bailout!
`bool bailed_out() const { return _bailout_msg != nullptr; }`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25188#discussion_r2091530392
More information about the hotspot-compiler-dev
mailing list