From patchwork Sat Feb 8 15:27:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37761 Received: (qmail 69157 invoked by alias); 8 Feb 2020 15:28:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 69140 invoked by uid 89); 8 Feb 2020 15:28:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.149.4) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Feb 2020 15:28:02 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway30.websitewelcome.com (Postfix) with ESMTP id C00AE2C425 for ; Sat, 8 Feb 2020 09:28:00 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 0S1Yj4gAoSl8q0S1Yjp84S; Sat, 08 Feb 2020 09:28:00 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TTseQo2LrIfTvubWIhhpw9KdP4N91PZz+RyX1krIzFU=; b=jw16YljQA7XiYwwPjtBXVgboUq hu2i5EelEbEhndJhy4L5k3+40cpI9vMQ0t7SML/6x3nx4ZY66/e+QbAlpbglsDZavsK895OEVL8Yt abNIur2B0ejLY6t2zCWX3kRIE; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:38112 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j0S1Y-001WwE-Hc; Sat, 08 Feb 2020 08:28:00 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/8] Dont' allow copying of auto_obstack Date: Sat, 8 Feb 2020 08:27:52 -0700 Message-Id: <20200208152758.29385-3-tom@tromey.com> In-Reply-To: <20200208152758.29385-1-tom@tromey.com> References: <20200208152758.29385-1-tom@tromey.com> Add DISABLE_COPY_AND_ASSIGN to struct auto_obstack, to prevent copying it. Copying an auto_obstack would be a bug. gdb/ChangeLog 2020-02-08 Tom Tromey * gdb_obstack.h (struct auto_obstack): Use DISABLE_COPY_AND_ASSIGN. Change-Id: Ic9e5ab20acfcfa61c241fed4d99bbb1caefba3cd --- gdb/ChangeLog | 5 +++++ gdb/gdb_obstack.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gdb/gdb_obstack.h b/gdb/gdb_obstack.h index fb9295f5020..9b1d907678f 100644 --- a/gdb/gdb_obstack.h +++ b/gdb/gdb_obstack.h @@ -125,6 +125,8 @@ struct auto_obstack : obstack ~auto_obstack () { obstack_free (this, NULL); } + DISABLE_COPY_AND_ASSIGN (auto_obstack); + /* Free all memory in the obstack but leave it valid for further allocation. */ void clear ()