PR25993, read of freed memory

Christian Biesinger cbiesinger@google.com
Tue May 19 18:58:46 GMT 2020


On Tue, May 19, 2020 at 12:27 PM Simon Marchi <simark@simark.ca> wrote:
>
> On 2020-05-19 1:25 p.m., Christian Biesinger wrote:
> > On Tue, May 19, 2020 at 8:27 AM Simon Marchi <simark@simark.ca> wrote:
> >> Can you please change `char *name` to be `gdb::optional<std::string>`?
> >>
> >> The caller that passes a name should use string_printf to build the string, as mentioned
> >> above.  The caller that does not pass a name can pass `{}`, to pass an empty optional.
> >
> > We may want to add C++17's std::nullopt to gdb::optional, to make it
> > clearer what's going on there. Then you could pass gdb::nullopt
> > instead of {}.
>
> If it's technically possible, I completely agree.

Yep, it is. Sent a patch to add it.

Christian


More information about the Binutils mailing list