RFR: 8263504: Some OutputMachOpcodes fields are uninitialized
Vladimir Kozlov
kvn at openjdk.java.net
Fri Mar 12 17:31:07 UTC 2021
On Fri, 12 Mar 2021 12:55:04 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> SonarCloud reports:
> 2 uninitialized fields at the end of the constructor calls
>
> class OutputMachOpcodes : public OutputMap {
> int begin_inst_chain_rule;
> int end_inst_chain_rule;
> int begin_rematerialize; // <--- this
> int end_rematerialize; // <--- and this
> int end_instructions;
> public:
> OutputMachOpcodes(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
> : OutputMap(hpp, cpp, globals, AD, "MachOpcodes"),
> begin_inst_chain_rule(-1), end_inst_chain_rule(-1), end_instructions(-1)
>
> They are written on all paths that I can see, but they should be initialized anyway, at least for proper checks in `closing()`.
Good and trivial.
-------------
Marked as reviewed by kvn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2967
More information about the hotspot-compiler-dev
mailing list