From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id F15393851517; Thu, 27 Oct 2022 13:57:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F15393851517 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666879029; bh=5eBnvkc2/qpwcqo7oWbsqiAp2gIyS8HI60ApWkByGRM=; h=From:To:Subject:Date:From; b=j57mdK7NIGdA35cGlf7QeerprGQP3BB2NhY53+St+9J8AEUBOivsegWjZcVyq9xUf h2qYUUxSXnqm90zOnJGmSVBy0oOVoKHhOq9ywlwmy5nQ10ooQKl5xJuZqLHhfUisy8 ZddrUtyRueodGBos739724MdNzJqjvv6ggj06u0U= 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: 0ca08c2c7b100baaebbd60744110102611f9b895 X-Git-Newrev: dc8f9560104f0803e53fa23bfd011aa9878d5a97 Message-Id: <20221027135709.F15393851517@sourceware.org> Date: Thu, 27 Oct 2022 13:57:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dc8f9560104f0803e53fa23bfd011aa9878d5a97 commit dc8f9560104f0803e53fa23bfd011aa9878d5a97 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;