From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@ericsson.com>
Cc: <gdb-patches@sourceware.org>, Keith Seitz <keiths@redhat.com>
Subject: Re: [PATCH] compile: Remove non-const reference parameters
Date: Mon, 17 Sep 2018 06:32:00 -0000 [thread overview]
Message-ID: <874leoocso.fsf@tromey.com> (raw)
In-Reply-To: <1535647635-9566-1-git-send-email-simon.marchi@ericsson.com> (Simon Marchi's message of "Thu, 30 Aug 2018 12:47:15 -0400")
>>>>> "Simon" == Simon Marchi <simon.marchi@ericsson.com> writes:
Simon> As mentioned here:
Simon> https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Avoid_non-const_reference_parameters.2C_use_pointers_instead
Simon> we prefer to avoid non-const references. This patch changes the
Simon> non-const references I could find in the compile/ directory, either by
Simon> making them const or changing them to pointers.
Simon> I'd say all the changes are pretty obvious, except the one in
Simon> compile_cplus_instance::enter_scope which might require more attention.
I think this particular change introduced a regression. runtest
gdb.compile/*.exp causes gdb to crash for me several times on x86-64
Fedora 28.
The code does this:
/* Save the new scope. */
m_scopes.push_back (std::move (new_scope));
... but then later code in the function continues to use new_scope,
like:
std::for_each
(new_scope.begin (), new_scope.end () - 1,
Tom
next prev parent reply other threads:[~2018-09-17 6:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-30 16:47 Simon Marchi
2018-08-30 21:57 ` Keith Seitz
2018-08-31 14:41 ` Tom Tromey
2018-09-06 10:27 ` Simon Marchi
2018-09-06 12:43 ` Tom Tromey
2018-09-06 12:49 ` Simon Marchi
2018-09-17 6:32 ` Tom Tromey [this message]
2018-09-17 13:29 ` Keith Seitz
2018-09-17 13:52 ` [PATCH] Fix use-after-move in compile/compile-cplus-types.c Simon Marchi
2018-09-17 15:25 ` Keith Seitz
2018-09-17 17:10 ` Simon Marchi
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=874leoocso.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
--cc=simon.marchi@ericsson.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