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.
This commit is contained in:
Nathaniel Filardo
2019-06-25 15:44:13 +01:00
parent 0b47145526
commit c7d509e418

View File

@@ -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<size_t>(reinterpret_cast<uintptr_t>(p) % align) != 0)
abort();
our_free(p);