From 93bb037c643f6f9ce9d00fa3c56217339a0d3ee2 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Mon, 18 Oct 2021 12:04:09 +0100 Subject: [PATCH] Fixed bounds calculation for domestication Bug: bounds was base,size but code used it as base, end. --- src/backend/fixedglobalconfig.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/backend/fixedglobalconfig.h b/src/backend/fixedglobalconfig.h index 761c371..f03bc99 100644 --- a/src/backend/fixedglobalconfig.h +++ b/src/backend/fixedglobalconfig.h @@ -66,10 +66,8 @@ namespace snmalloc UNUSED(ls); auto address = address_cast(p); - auto bounds = Backend::Pagemap::get_bounds(nullptr); - if ( - (address < bounds.first) || (address > bounds.second) || - ((bounds.second - address) < sz)) + auto [base, length] = Backend::Pagemap::get_bounds(nullptr); + if ((address - base > (length - sz)) || (length < sz)) { return nullptr; }