pagemap: cast uintptr_t to size_t before bit math
Not strictly necessary, but makes the CHERI compiler happier to see that we're using a decidedly integral type rather than a possibly tagged quantity.
This commit is contained in:
@@ -191,7 +191,7 @@ namespace snmalloc
|
||||
return std::pair(nullptr, 0);
|
||||
|
||||
shift -= BITS_PER_INDEX_LEVEL;
|
||||
ix = (addr >> shift) & ENTRIES_MASK;
|
||||
ix = (static_cast<size_t>(addr) >> shift) & ENTRIES_MASK;
|
||||
e = &value->entries[ix];
|
||||
|
||||
if constexpr (INDEX_LEVELS == 1)
|
||||
@@ -211,7 +211,7 @@ namespace snmalloc
|
||||
return std::pair(nullptr, 0);
|
||||
|
||||
shift -= BITS_FOR_LEAF;
|
||||
ix = (addr >> shift) & LEAF_MASK;
|
||||
ix = (static_cast<size_t>(addr) >> shift) & LEAF_MASK;
|
||||
return std::pair(leaf, ix);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user