From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] Merge forward-search/reverse-search, use gdb::def_vector, remove limit (Re: [RFA] Fix leak in forward-search)
Date: Sat, 08 Dec 2018 15:12:00 -0000 [thread overview]
Message-ID: <037c46b7-77b3-b966-69f3-ecb522ebd23c@redhat.com> (raw)
In-Reply-To: <871s72mh5i.fsf@tromey.com>
On 11/30/2018 08:42 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
> Pedro> -/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
>
> I'm surprised all those exclamation marks didn't help us find this
> sooner. /s
>
> Pedro> I don't think there's much point in reusing the buffer across
> Pedro> command invocations.
>
> Agreed.
>
> Pedro> - msg = (char *) re_comp (regex);
> Pedro> + char *msg = (char *) re_comp (regex);
>
> Pre-existing, but I wonder why this cast is needed. I think "const char
> *msg" and removing the cast ought to be completely fine.
Yeah. I did this, and pushed the patch.
> Or (more work)
> avoid re_comp and use compiled_regex instead.
I looked at this a bit, but decided not to do it, at least not in
this patch, because there are several other re_comp calls in the
tree, which made me think that it'd be better to do a pass
tweaking all the same time. While considering that, it seems like
we end up having to pass a string as 3rd argument to compile_regex's
ctor and many different places, which makes me think that perhaps
that argument should have a default. Similar consideration for
the compile_regex::exec method, and all arguments but the first.
Thanks,
Pedro Alves
>
> The rest seems fine to me. Thank you for doing this.
>
> Tom
>
next prev parent reply other threads:[~2018-12-08 15:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-27 23:34 [RFA] Fix leak in forward-search Philippe Waroquiers
[not found] ` <3cf960b8-ff82-0670-fa90-c94d78573bfe@redhat.com>
2018-11-29 23:05 ` Philippe Waroquiers
2018-11-30 19:43 ` [PATCH] Merge forward-search/reverse-search, use gdb::def_vector, remove limit (Re: [RFA] Fix leak in forward-search) Pedro Alves
2018-11-30 20:42 ` Tom Tromey
2018-12-08 15:12 ` Pedro Alves [this message]
2018-12-02 16:57 ` Philippe Waroquiers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=037c46b7-77b3-b966-69f3-ecb522ebd23c@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox