Fix munmap(2) splitting segments instead of deleting from the right.
An erroneous split could create an invalid zero size segment.
This commit is contained in:
parent
15bf43249a
commit
7d16956808
1 changed files with 2 additions and 2 deletions
|
@ -133,8 +133,8 @@ void UnmapMemory(Process* process, uintptr_t addr, size_t size)
|
|||
continue;
|
||||
}
|
||||
|
||||
// Delete the middle of the segment if covered there by our request.
|
||||
if ( conflict->addr < addr && addr + size - conflict->addr <= conflict->size )
|
||||
// Delete the middle of the segment if our request splits it in two.
|
||||
if ( conflict->addr < addr && addr + size < conflict->size + conflict->addr )
|
||||
{
|
||||
Memory::UnmapRange(addr, size, PAGE_USAGE_USER_SPACE);
|
||||
Memory::Flush();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue