Skip to content

Commit 11a9e9e

Browse files
committed
Fix crash on a chain of page faults in the middle of the dynamic core caching the next block
1 parent e53bece commit 11a9e9e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cpu/paging.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,16 @@ bool PAGING_MakePhysPage(Bitu & page) {
13301330
// check the page table entry
13311331
X86PageEntry tbl_entry;
13321332
tbl_entry.load = phys_readd(GetPageTableEntryAddr(page<<12, dir_entry));
1333+
#ifndef C_DBP_PAGE_FAULT_QUEUE_WIPE
13331334
if (!tbl_entry.block.p) return false;
1335+
#else
1336+
if (!tbl_entry.block.p) {
1337+
// During page fault wipe this can fail but we still return true to avoid a crash caused by MakeCodePage failing with "DYNX86:Can't find physpage" due to this.
1338+
// This is fine because the page fault wipe will revert state back to what it was during the page fault anyway.
1339+
if (!DOSBOX_IsWipingPageFaultQueue)
1340+
return false;
1341+
}
1342+
#endif
13341343

13351344
// return it
13361345
page = tbl_entry.block.base;

0 commit comments

Comments
 (0)