TD3 II.4 Betten error handling on ForkExec()

This commit is contained in:
Yorick Barbanneau 2021-12-17 00:36:28 +01:00
parent 215a071a13
commit 20e058d610
2 changed files with 5 additions and 3 deletions

View file

@ -102,7 +102,9 @@ AddrSpace::AddrSpace (OpenFile * executable)
// pageTable[i].physicalPage = i; // for now, phys page # = virtual page #
#ifdef CHANGED
int newPage = pageProvider->GetEmptyPage();
ASSERT(newPage != -1);
if (newPage == -1) {
throw std::bad_alloc();
}
pageTable[i].physicalPage = newPage;
#endif
pageTable[i].valid = TRUE;