mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-08-29 05:35:51 +00:00
Make invalid mprotects warn instead of panicking
This commit is contained in:
parent
fe06d02baf
commit
c0794dd3d5
1 changed files with 4 additions and 2 deletions
|
@ -114,8 +114,10 @@ void Kernel::controlMemory() {
|
||||||
// Official kernel has an internal state bit to indicate that the region's permissions may be changed
|
// Official kernel has an internal state bit to indicate that the region's permissions may be changed
|
||||||
// But this should account for all cases
|
// But this should account for all cases
|
||||||
if (!mem.testMemoryState(addr0, pages, MemoryState::Private) && !mem.testMemoryState(addr0, pages, MemoryState::Alias) &&
|
if (!mem.testMemoryState(addr0, pages, MemoryState::Private) && !mem.testMemoryState(addr0, pages, MemoryState::Alias) &&
|
||||||
!mem.testMemoryState(addr0, pages, MemoryState::Aliased) && !mem.testMemoryState(addr0, pages, MemoryState::AliasCode))
|
!mem.testMemoryState(addr0, pages, MemoryState::Aliased) && !mem.testMemoryState(addr0, pages, MemoryState::AliasCode)) {
|
||||||
Helpers::panic("Tried to mprotect invalid region!");
|
Helpers::warn("Tried to mprotect invalid region!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mem.changePermissions(addr0, pages, r, w, false);
|
mem.changePermissions(addr0, pages, r, w, false);
|
||||||
regs[1] = addr0;
|
regs[1] = addr0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue