Allocator: Early return if past the end of the allocation range

Fixes a bug where it would eventually hit the stack region and remap the
range as RW even for ranges that don't overlap the stack.
This commit is contained in:
Ryan Houdek 2024-02-21 15:37:46 -08:00
parent 66feea9e8e
commit 3d671cba10
No known key found for this signature in database

View File

@ -297,6 +297,12 @@ namespace FEXCore::Allocator {
if (c == ' ') {
STEAL_LOG("[%d] ParseEnd; RegionBegin: %016lX RegionEnd: %016lX\n", __LINE__, RegionBegin, RegionEnd);
if (RegionEnd >= End) {
// Early return if we are completely beyond the allocation space.
close(MapsFD);
return Regions;
}
State = ScanEnd;
// If the previous map's ending and the region we just parsed overlap the stack then we need to save the stack mapping.