From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 9A8013858D1E for ; Wed, 20 Mar 2024 16:57:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9A8013858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9A8013858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710953871; cv=none; b=Tlo/kXWBgG/R2zplF3qD/Y3PWxlckb36l67N0ayOeCVO1MgamyyD86/mO6CoYTk9GtsZgjgdwc82Qd7+ScDDymkBKEAhwVDwhXQIx+NGKbRF2SdLAKfCrXiN0qJwOtfBO6IVdq1r0OSiORvOydmzddbJiy8ff4ooeNiKKF9Sz6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710953871; c=relaxed/simple; bh=kek/3e3rzviHRvusUcBc/rMvXVxRZP3KLhJe74sdpjY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=OqXzr3RDNMiahWZdRI3vn/3PQ0LTQu6oWKkIe2anpFGdgE/fzqCun944HhE8j0+7EsPcmwkY8Pue/xLPM+yAV5yBknQxH0lj/jimga++u70JfElj0NR24G0NAGqw9qszbEZrvtBgZi4RN3KOu7q+NcXtFTmRWF6DWAatxkT0RGQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6010a.ext.cloudfilter.net ([10.0.30.248]) by cmsmtp with ESMTPS id myjfrMaGwQr4SmzG8rVC2H; Wed, 20 Mar 2024 16:57:49 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id mzG7r5fC0QufZmzG8rx2RX; Wed, 20 Mar 2024 16:57:48 +0000 X-Authority-Analysis: v=2.4 cv=eK4Vjmp1 c=1 sm=1 tr=0 ts=65fb158c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=K6JAEmCyrfEA:10 a=Qbun_eYptAEA:10 a=zstS-IiYAAAA:8 a=q8s1-EfS3vGMQBL63m4A:9 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To: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=EVkZIbCq9YbnW8uB692bxdC1sdV5bF/PE2QRiT1Wtys=; b=QRRoe1V2+qOlu7cCaXb6y4E2Em PHxKEwCdrALEvh4BRG2R1AEvHkuD5JpVU4+tPW73U9GvP6i6s0ucoyFhonA2ulrSxUq20IEdgkwGA HJy+q4MCacEKfEaNC70k4AbGp; Received: from 97-122-82-115.hlrn.qwest.net ([97.122.82.115]:48432 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rmzG7-00115n-2I; Wed, 20 Mar 2024 10:57:47 -0600 From: Tom Tromey To: Hannes Domani Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix reinterpret_cast for classes with multiple inheritance References: <20240320160115.94-1-ssbssa.ref@yahoo.de> <20240320160115.94-1-ssbssa@yahoo.de> X-Attribution: Tom Date: Wed, 20 Mar 2024 10:57:46 -0600 In-Reply-To: <20240320160115.94-1-ssbssa@yahoo.de> (Hannes Domani's message of "Wed, 20 Mar 2024 17:01:15 +0100") Message-ID: <87r0g4g7sl.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.82.115 X-Source-L: No X-Exim-ID: 1rmzG7-00115n-2I X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-82-115.hlrn.qwest.net (murgatroyd) [97.122.82.115]:48432 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLNc0SDeWRbvpvE3pwAsJjXmYfhRQaXSfAav4wRPeoi7WeOyL+VcO9mg//B3BCBt61jqdKzD8B/AVVm8bv8r4bYQXpmYjOGQOvbNxlnv78ogs4Z7uFQ4 1dw89zItsj1paYGnJs6/gzm8n4MHsXpISE0YaNdakBSkgp2VwkhoDiYOQ6sWdimzD/AC7CX8/Rn8Ml/BRLlfyYVW+KY5hPD0Vec= X-Spam-Status: No, score=-3015.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Hannes" == Hannes Domani writes: Hannes> Currently a reinterpret_cast may change the pointer value if Hannes> multiple inheritance is involved: Thanks for the patch. Hannes> + else if (dest_code == TYPE_CODE_PTR && arg_code == TYPE_CODE_PTR) Hannes> + { Hannes> + /* Don't do any up- or downcasting. */ Hannes> + result = arg->copy (); Hannes> + result->deprecated_set_type (dest_type); Hannes> + result->set_enclosing_type (dest_type); Hannes> + result->set_pointed_to_offset (0); /* pai: chk_val */ I don't think anybody knows what this comment means in the other spots it appears. I guess "pai" is some gdb maintainer from the distant past, though I don't know their real name. Anyway, please remove this comment. Ok with this change. Approved-By: Tom Tromey Tom