RFR: JDK-8222079: Don't use memset to initialize fields decode_env constructor in disassembler.cpp

Doerr, Martin martin.doerr at sap.com
Thu Jul 4 14:05:50 UTC 2019


Hi Roman,

> I fixed the initialization of the other fields.
> 
> I also spotted 3 other constructors with the same problems, so I treated
> them the same.
Excellent.

> Good now?
Yes. Thank you.

Best regards,
Martin


> -----Original Message-----
> From: Roman Kennke <rkennke at redhat.com>
> Sent: Donnerstag, 4. Juli 2019 15:57
> To: Doerr, Martin <martin.doerr at sap.com>; dean.long at oracle.com;
> hotspot-compiler-dev at openjdk.java.net
> Subject: Re: RFR: JDK-8222079: Don't use memset to initialize fields
> decode_env constructor in disassembler.cpp
> 
> Hi Martin,
> 
> I put in memset again, but only for _output_buf this time. GCC doesn't
> complain about that. With c++11 we could do {} but not with c++99. :-(
> 
> I fixed the initialization of the other fields.
> 
> I also spotted 3 other constructors with the same problems, so I treated
> them the same.
> 
> http://cr.openjdk.java.net/~rkennke/JDK-8222079/webrev.03/
> 
> Good now?
> 
> Thanks,
> Roman
> 
> 
> > Hi Roman,
> >
> > thanks for cleaning this up.
> >
> > Does "_option_buf()" have any effect?
> > I think default initialization of char elements are no-ops (=> undefined).
> >
> > Ah, I just noticed that Thomas has found this, too.
> >
> > Can you use "_output(output != NULL ? output : tty)" and
> "_codeBuffer(code)" and remove the lines below your new code, please?
> >
> > Best regards,
> > Martin
> >
> >
> >> -----Original Message-----
> >> From: hotspot-compiler-dev <hotspot-compiler-dev-
> >> bounces at openjdk.java.net> On Behalf Of Roman Kennke
> >> Sent: Donnerstag, 4. Juli 2019 13:11
> >> To: dean.long at oracle.com; hotspot-compiler-dev at openjdk.java.net
> >> Subject: Re: RFR: JDK-8222079: Don't use memset to initialize fields
> >> decode_env constructor in disassembler.cpp
> >>
> >> Uh I just went through my list of open bugs only to realize that I
> >> totally forgot to push this one. Some things changed in the meantime, so
> >> here comes an updated patch:
> >>
> >> http://cr.openjdk.java.net/~rkennke/JDK-8222079/webrev.02/
> >>
> >> Can I please get another review?
> >>
> >> Thanks,
> >> Roman
> >>
> >>
> >>> Looks good.
> >>>
> >>> dl
> >>>
> >>> On 5/3/19 9:59 AM, Roman Kennke wrote:
> >>>> Ping?
> >>>>
> >>>> Thanks,
> >>>> Roman
> >>>>
> >>>>
> >>>>> Recent gcc (I use version 9) complains about using memset to
> >>>>> initialize fields of decode_env. Let's use proper field initializers
> >>>>> instead.
> >>>>>
> >>>>> Bug:
> >>>>> https://bugs.openjdk.java.net/browse/JDK-8222079
> >>>>> Webrev:
> >>>>> http://cr.openjdk.java.net/~rkennke/JDK-8222079/webrev.01/
> >>>>>
> >>>>> Can I please get a review?
> >>>>>
> >>>>> Thanks, Roman
> >>>
> >



More information about the hotspot-compiler-dev mailing list