mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 14:00:16 +02:00
Handle zero length in ChangeProtectionFlags
Add a no-op for zero length in ChangeProtectionFlags. This fixes AMD Vivado 2025.2 which tries to mprotect with 0 as size and merge strategies fails: ``` Unexpected ChangeProtectionFlags Merge strategy! [0x400000, 0x401000) Versus [0x0, 0x0) ```
This commit is contained in:
1 parent
d21351e66e
commit
3462dc3e14
1 file changed
+5
@@ -281,6 +281,11 @@ void VMATracking::DeleteVMARange(FEXCore::Context::Context* CTX, uintptr_t Base,
|
||||
void VMATracking::ChangeProtectionFlags(uintptr_t Base, uintptr_t Length, VMAProt NewProt) {
|
||||
Mutex.check_lock_owned_by_self_as_write();
|
||||
|
||||
// Handle 0 size as no-op like the kernel
|
||||
if (Length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This needs to handle multiple split-merge strategies:
|
||||
// 1) Exact overlap - No Split, no Merge. Only protection tracking changes.
|
||||
// 2) Exact base overlap - Single insert, can never fail.
|
||||
|
||||
Reference in new issue
Block a user