From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id 5F5283856DFA; Thu, 5 May 2022 12:04:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F5283856DFA Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Matthew Malcomson To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] Minor fix to __capability handling X-Act-Checkin: gcc X-Git-Author: Matthew Malcomson X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: 9336ef23d4c7324d7269417d21ba2f7fc0a60057 X-Git-Newrev: 30e16bf212a0692e9b3b34e19102c4f13af88740 Message-Id: <20220505120419.5F5283856DFA@sourceware.org> Date: Thu, 5 May 2022 12:04:19 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2022 12:04:19 -0000 https://gcc.gnu.org/g:30e16bf212a0692e9b3b34e19102c4f13af88740 commit 30e16bf212a0692e9b3b34e19102c4f13af88740 Author: Matthew Malcomson Date: Thu Mar 17 15:49:44 2022 +0000 Minor fix to __capability handling Ensure we modify the `treetoedit` pointer we look through rather than `node` directly. Diff: --- gcc/c-family/c-attribs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c index 7ab3e41f626..7b299b9ce9e 100644 --- a/gcc/c-family/c-attribs.c +++ b/gcc/c-family/c-attribs.c @@ -857,7 +857,7 @@ handle_cheri_capability_attribute (tree *node, tree ARG_UNUSED (name), POINTER_TYPE_P. */ tree *treetoedit = node; for (int i = 1; i < capability_pointer_depth; i++) - treetoedit = &TREE_TYPE (*node); + treetoedit = &TREE_TYPE (*treetoedit); gcc_assert (TREE_CODE (*treetoedit) == POINTER_TYPE); /* Call build_pointer_type_for_mode to create a Capability Pointer