haze: fix pointer overflow check

This commit is contained in:
Liam 2023-04-15 20:35:52 -04:00
parent 6c99a828af
commit 3630e10874

View file

@ -56,7 +56,7 @@ namespace haze {
constexpr bool AllocationIsSatisfyable(size_t n) const {
/* Check for overflow. */
if (this->GetNextAddress() + n < this->GetNextAddress()) {
if (!util::CanAddWithoutOverflow(reinterpret_cast<uintptr_t>(this->GetNextAddress()), n)) {
return false;
}