Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Keith Seitz <keiths@redhat.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix use-after-move in compile/compile-cplus-types.c
Date: Mon, 17 Sep 2018 17:10:00 -0000	[thread overview]
Message-ID: <f927fbab8f689b980fc0ac3b7ae78aa6@polymtl.ca> (raw)
In-Reply-To: <539a8428-a038-aeb7-0a1c-edbe99cda98d@redhat.com>

On 2018-09-17 11:25, Keith Seitz wrote:
> On 09/17/2018 06:52 AM, Simon Marchi wrote:
>> Patch
>> 
>>   d82b3862f12 ("compile: Remove non-const reference parameters")
>> 
>> introduced a regression in compile/compile-cplus-types.c.  The 
>> new_scope
>> variable in compile_cplus_instance::enter_scope is used after it was
>> std::moved.  This patch fixes it by referring to the back of the 
>> vector
>> where it was moved instead.
>> 
>> gdb/ChangeLog:
>> 
>> 	* compile/compile-cplus-types.c
>> 	(compile_cplus_instance::enter_scope): Don't use new_scope after
>> 	std::move.
> 
> That LGTM. [Although I would have used a const reference to it 
> everywhere, but
> six of one, ...]

Yeah, I thought about that too, but then I didn't know what to name the 
new variable, since "new_scope" is already taken.  So in the end I chose 
the solution where I didn't have to choose a name :).

> PS. Reminder: IANAM, but you are. So please approve your patch. :-)

Thanks for taking a look, I am pushing it.

Simon


      reply	other threads:[~2018-09-17 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 16:47 [PATCH] compile: Remove non-const reference parameters 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
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 [this message]

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=f927fbab8f689b980fc0ac3b7ae78aa6@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --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