mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 18:00:17 +02:00
Syscalls: Make sure to munmap on full brk zero
Failed to munmap in this case.
This commit is contained in:
1 file changed
+5
@@ -709,6 +709,11 @@ uint64_t SyscallHandler::HandleBRK(FEXCore::Core::CpuStateFrame* Frame, void* Ad
|
||||
// Not allowed to move brk end below original start
|
||||
// Set the size to zero
|
||||
DataSpaceSize = 0;
|
||||
|
||||
// Munmap the whole space.
|
||||
[[maybe_unused]] auto ok = GuestMunmap(Frame->Thread, reinterpret_cast<void*>(DataSpace), DataSpaceMappedSize);
|
||||
LOGMAN_THROW_A_FMT(ok != -1, "Munmap failed");
|
||||
DataSpaceMappedSize = 0;
|
||||
} else {
|
||||
uint64_t NewSize = NewEnd - DataSpace;
|
||||
uint64_t NewSizeAligned = FEXCore::AlignUp(NewSize, 4096);
|
||||
|
||||
Reference in new issue
Block a user