RFR: JDK-8318671: Potential uninitialized uintx value after JDK-8317683

David Holmes dholmes at openjdk.org
Tue Oct 24 10:29:31 UTC 2023


On Tue, 24 Oct 2023 07:08:07 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> When using 'MemStat' CompileCommand, we accidentally register the command if an invalid suboption had been specified. Fixed, added regression test (verified).

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.

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

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


More information about the hotspot-compiler-dev mailing list