From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 98C5F385780A; Fri, 5 Aug 2022 19:35:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98C5F385780A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] cheri: malloc: avoid switch over uintptr_t X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: 6af67120e8d889f1595d9d066d7798a8fba8a9db X-Git-Newrev: 257781e305b49b3fd4a9b23f8279ded07a395e29 Message-Id: <20220805193555.98C5F385780A@sourceware.org> Date: Fri, 5 Aug 2022 19:35:55 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2022 19:35:55 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=257781e305b49b3fd4a9b23f8279ded07a395e29 commit 257781e305b49b3fd4a9b23f8279ded07a395e29 Author: Szabolcs Nagy Date: Mon Mar 28 13:57:10 2022 +0100 cheri: malloc: avoid switch over uintptr_t We should use a type that guarantees to represent all address bits. In CHERI C this would be ptraddr_t, but we use unsigned long for now not to cause regressions on other targets where this type is missing. Diff: --- malloc/mcheck-impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc/mcheck-impl.c b/malloc/mcheck-impl.c index 00b766219b..e908bfd062 100644 --- a/malloc/mcheck-impl.c +++ b/malloc/mcheck-impl.c @@ -74,7 +74,7 @@ checkhdr (const struct hdr *hdr) an error and report it. */ return MCHECK_OK; - switch (hdr->magic ^ ((uintptr_t) hdr->prev + (uintptr_t) hdr->next)) + switch (hdr->magic ^ ((unsigned long) hdr->prev + (unsigned long) hdr->next)) { default: status = MCHECK_HEAD;