From c7d509e4181318bc3b7fce0de9bf3dab10d9eb7f Mon Sep 17 00:00:00 2001 From: Nathaniel Filardo Date: Tue, 25 Jun 2019 15:44:13 +0100 Subject: [PATCH] test/func/malloc: align check as size_t If the test happens as uintptr_t on CHERI, then we attempt to construct a capability and use a capability-based test rather than an integer-based one, and things go south. --- src/test/func/malloc/malloc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/func/malloc/malloc.cc b/src/test/func/malloc/malloc.cc index a2d8600..446edf3 100644 --- a/src/test/func/malloc/malloc.cc +++ b/src/test/func/malloc/malloc.cc @@ -21,7 +21,7 @@ void check_result(size_t size, size_t align, void* p, int err, bool null) if (our_malloc_usable_size(p) < size) abort(); - if (((uintptr_t)p % align) != 0) + if (static_cast(reinterpret_cast(p) % align) != 0) abort(); our_free(p);