RFR: JDK-8318671: Potential uninitialized uintx value after JDK-8317683 [v2]

David Holmes dholmes at openjdk.org
Wed Oct 25 22:18:29 UTC 2023


On Tue, 24 Oct 2023 12:26:46 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/compiler/compilerOracle.cpp line 650:
>> 
>>> 648:     } else {
>>> 649:       jio_snprintf(errorbuf, buf_size, "MemStat: invalid value expected 'collect' or 'print' (omitting value means 'collect')");
>>> 650:       return handled_err;
>> 
>> If "omitting value means 'collect'" then why do we not simply set `value = (uintx)MemStatAction::collect` ? Otherwise what is that message supposed to mean?
>> 
>> Ternary return values are unpleasant.
>
>> If "omitting value means 'collect'" then why do we not simply set value = (uintx)MemStatAction::collect ? Otherwise what is that message supposed to mean?
> 
> We only enter this function if a value for this command had been given (`-XX:CompileCommand=<command>,<method>[,<value>]`). The default case is handled somewhere else (CompilerOracle::parse_from_line).
> 
>> Ternary return values are unpleasant.
> 
> As, on a general base? You don't like the number three :-) ?
> 
> Here, we have to distinguish between:
> - not handled, its not a command option that accepts enum strings
> - handled, with two variants: handled, had an error, and handled, had no error. Only in the latter case we want to register the command.

Okay I'll butt out. The comment doesn't make sense to me.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16335#discussion_r1372376867


More information about the serviceability-dev mailing list