From 71c04db60a85cba7b22845862a19b51ae5f05733 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 25 Jan 2025 15:31:56 -0500 Subject: [PATCH] kernel/vm: Reinstate assertion in InsertPage. And fix it to be < not <= as well, and the same in MovePage. --- src/system/kernel/vm/VMCache.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/vm/VMCache.cpp b/src/system/kernel/vm/VMCache.cpp index 613424b754..03a27bb87b 100644 --- a/src/system/kernel/vm/VMCache.cpp +++ b/src/system/kernel/vm/VMCache.cpp @@ -791,9 +791,7 @@ VMCache::InsertPage(vm_page* page, off_t offset) T2(InsertPage(this, page, offset)); AssertLocked(); -#if 0 - ASSERT(offset >= virtual_base && offset <= virtual_end); -#endif + ASSERT(offset >= virtual_base && offset < virtual_end); if (page->CacheRef() != NULL) { panic("insert page %p into cache %p: page cache is set to %p\n", @@ -857,7 +855,7 @@ VMCache::MovePage(vm_page* page, off_t offset) AssertLocked(); oldCache->AssertLocked(); - ASSERT(offset >= virtual_base && offset <= virtual_end); + ASSERT(offset >= virtual_base && offset < virtual_end); // remove from old cache oldCache->pages.Remove(page);