Fix crash bugs

This commit is contained in:
Hamish Milne 2020-01-06 23:20:18 +00:00 committed by zhupengfei
parent 116d22d562
commit f2de70c3fb
8 changed files with 32 additions and 21 deletions

View file

@ -452,6 +452,9 @@ MemoryRef MemorySystem::GetPhysicalRef(PAddr address) {
default:
UNREACHABLE();
}
if (offset_into_region >= target_mem->GetSize()) {
return {nullptr};
}
return {target_mem, offset_into_region};
}