kernel/vm: Reinstate assertion in InsertPage.

And fix it to be < not <= as well, and the same in MovePage.
This commit is contained in:
Augustin Cavalier 2025-01-25 15:31:56 -05:00
parent 5bfe88b36b
commit 71c04db60a

View File

@ -791,9 +791,7 @@ VMCache::InsertPage(vm_page* page, off_t offset)
T2(InsertPage(this, page, offset)); T2(InsertPage(this, page, offset));
AssertLocked(); AssertLocked();
#if 0 ASSERT(offset >= virtual_base && offset < virtual_end);
ASSERT(offset >= virtual_base && offset <= virtual_end);
#endif
if (page->CacheRef() != NULL) { if (page->CacheRef() != NULL) {
panic("insert page %p into cache %p: page cache is set to %p\n", 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(); AssertLocked();
oldCache->AssertLocked(); oldCache->AssertLocked();
ASSERT(offset >= virtual_base && offset <= virtual_end); ASSERT(offset >= virtual_base && offset < virtual_end);
// remove from old cache // remove from old cache
oldCache->pages.Remove(page); oldCache->pages.Remove(page);