pagemap: cast to size_t then do bit manip

Makes the CHERI compiler happier
This commit is contained in:
Nathaniel Filardo
2019-11-26 18:13:22 +00:00
parent 5ae8ecedee
commit 7afc6da566

View File

@@ -387,7 +387,7 @@ namespace snmalloc
*/
size_t index_for_address(uintptr_t p)
{
return reinterpret_cast<size_t>((p >> SHIFT) & (OS_PAGE_SIZE - 1));
return bits::align_down(static_cast<size_t>(p) >> SHIFT, OS_PAGE_SIZE);
}
/**