From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id AD70B383FBBD; Wed, 26 Oct 2022 15:18:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD70B383FBBD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666797512; bh=G0DVL+Gtjjx8AG8lMsRlaxuSolk0wHSnaWVKa+r7iPQ=; h=From:To:Subject:Date:From; b=ZoHXtknxB5zf/d7yxeus46UNtmqr1NAxYqVOMZqk5VIgYY3v8GwlUmQVO18OPxfdj SybQdL4j+jhHuT2pIsZevy18cVjVWB1UjL4kBC7mvytOM0FhedIze/K/guxfVvq4nc 6geo6MdcALxDYmU8Nje8m850x2ZPYJUCuKPHZaoc= 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: 281929afda989a938a1fec31613c1c548ceecbaa X-Git-Newrev: 9e7e937778da85d4fafc05f521c860a3037da541 Message-Id: <20221026151832.AD70B383FBBD@sourceware.org> Date: Wed, 26 Oct 2022 15:18:32 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9e7e937778da85d4fafc05f521c860a3037da541 commit 9e7e937778da85d4fafc05f521c860a3037da541 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;