RFR: 8227633: avoid comparing this pointers to NULL - was : RE: this-pointer NULL-checks in hotspot codebase [-Wtautological-undefined-compare]

Baesken, Matthias matthias.baesken at sap.com
Thu Jul 18 10:39:44 UTC 2019


Hi Martin, thanks for the  review !

Best regards, Matthias


> -----Original Message-----
> From: Doerr, Martin
> Sent: Mittwoch, 17. Juli 2019 17:40
> To: coleen.phillimore at oracle.com; hotspot-dev at openjdk.java.net;
> Baesken, Matthias <matthias.baesken at sap.com>
> Subject: RE: RFR: 8227633: avoid comparing this pointers to NULL - was : RE:
> this-pointer NULL-checks in hotspot codebase [-Wtautological-undefined-
> compare]
> 
> Hi Matthias,
> 
> looks good to me.
> 
> Please make sure that this change got built on all platforms we have.
> The adlc is used during build so if it has passed on all platforms, it should be
> ok.
> 
> Best regards,
> Martin
> 
> 
> > -----Original Message-----
> > From: hotspot-dev <hotspot-dev-bounces at openjdk.java.net> On Behalf
> Of
> > coleen.phillimore at oracle.com
> > Sent: Freitag, 12. Juli 2019 14:49
> > To: hotspot-dev at openjdk.java.net
> > Subject: Re: RFR: 8227633: avoid comparing this pointers to NULL - was : RE:
> > this-pointer NULL-checks in hotspot codebase [-Wtautological-undefined-
> > compare]
> >
> >
> >
> http://cr.openjdk.java.net/~mbaesken/webrevs/8227633.0/src/hotspot/sha
> > re/adlc/formssel.cpp.udiff.html
> >
> > + if (mnode) mnode->count_instr_names(names);
> >
> >
> > We also try to avoid implicit checks against null for pointers so change
> > this to:
> >
> > + if (mnode != NULL) mnode->count_instr_names(names);
> >
> > I didn't see that you added a check for NULL in the callers of
> > print_opcodes or setstr.  Can those callers never pass NULL?
> >
> > We've done a few passes to clean up these this == NULL checks. Thank you
> > for doing this!
> >
> > Coleen
> >



More information about the hotspot-dev mailing list