From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id F0C683958C1B for ; Tue, 4 May 2021 15:34:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F0C683958C1B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D001A56159; Tue, 4 May 2021 11:34:33 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bK7yAnBPjc0a; Tue, 4 May 2021 11:34:33 -0400 (EDT) Received: from murgatroyd (97-122-70-176.hlrn.qwest.net [97.122.70.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 80C8656154; Tue, 4 May 2021 11:34:33 -0400 (EDT) From: Tom Tromey To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/3] Add virtual destructor to dwarf2_per_cu_data References: <20210503193206.4008066-1-tromey@adacore.com> <20210503193206.4008066-2-tromey@adacore.com> X-Attribution: Tom Date: Tue, 04 May 2021 09:34:32 -0600 In-Reply-To: <20210503193206.4008066-2-tromey@adacore.com> (Tom Tromey's message of "Mon, 3 May 2021 13:32:04 -0600") Message-ID: <87r1imsebb.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2021 15:34:35 -0000 >>>>> "Tom" == Tom Tromey writes: Tom> Address sanitizer pointed out that the patch to use 'delete' for Tom> dwarf2_per_cu_data introduced a bug -- now it is possible to delete a Tom> signatured_type using a pointer to its base class. This patch fixes Tom> the problem by introducing a virtual destructor. I'm thinking that instead I should add a custom deleter for these objects that knows to cast to signatured_type when appropriate. This would avoid a vtable pointer just to hold the destructor. Tom