From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11638 invoked by alias); 17 Sep 2018 15:25:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 11277 invoked by uid 89); 17 Sep 2018 15:25:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=reminder X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Sep 2018 15:25:48 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A82CF88E54; Mon, 17 Sep 2018 15:25:47 +0000 (UTC) Received: from theo.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72B635B6F8; Mon, 17 Sep 2018 15:25:47 +0000 (UTC) Subject: Re: [PATCH] Fix use-after-move in compile/compile-cplus-types.c To: Simon Marchi , gdb-patches@sourceware.org References: <82a8995b-fd73-ad0b-ed82-64cdb0b54272@redhat.com> <20180917135203.10368-1-simon.marchi@ericsson.com> From: Keith Seitz Message-ID: <539a8428-a038-aeb7-0a1c-edbe99cda98d@redhat.com> Date: Mon, 17 Sep 2018 15:25:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180917135203.10368-1-simon.marchi@ericsson.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00582.txt.bz2 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, ...] Keith PS. Reminder: IANAM, but you are. So please approve your patch. :-)