Skip to content

Commit

Permalink
We should check against alloc_allocated instead of heap_segment_alloc…
Browse files Browse the repository at this point in the history
…ated for ephemeral segment (#2450)
  • Loading branch information
cshung authored Jul 29, 2021
1 parent 9dc72da commit 55dd35d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/SOS/Strike/eeheap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,12 @@ BOOL GCObjInSegment(TADDR taddrObj, const GCHeapDetails &heap,
ExtOut("Error requesting heap segment %p\n", SOS_PTR(taddrSeg));
return FALSE;
}
if (taddrObj >= TO_TADDR(dacpSeg.mem) && taddrObj && taddrObj < TO_TADDR(dacpSeg.allocated))
TADDR allocated = TO_TADDR(dacpSeg.allocated);
if (taddrSeg == TO_TADDR(heap.ephemeral_heap_segment))
{
allocated = TO_TADDR(heap.alloc_allocated);
}
if (taddrObj >= TO_TADDR(dacpSeg.mem) && taddrObj < allocated)
{
rngSeg.segAddr = (TADDR)dacpSeg.segmentAddr;
rngSeg.start = (TADDR)dacpSeg.mem;
Expand Down Expand Up @@ -776,7 +781,7 @@ BOOL GCObjInLargeSegment(TADDR taddrObj, const GCHeapDetails &heap, TADDR_SEGINF
ExtOut("Error requesting heap segment %p\n", SOS_PTR(taddrSeg));
return FALSE;
}
if (taddrObj >= TO_TADDR(dacpSeg.mem) && taddrObj && taddrObj < TO_TADDR(dacpSeg.allocated))
if (taddrObj >= TO_TADDR(dacpSeg.mem) && taddrObj < TO_TADDR(dacpSeg.allocated))
{
rngSeg.segAddr = (TADDR)dacpSeg.segmentAddr;
rngSeg.start = (TADDR)dacpSeg.mem;
Expand Down Expand Up @@ -809,7 +814,7 @@ BOOL GCObjInPinnedObjectSegment(TADDR taddrObj, const GCHeapDetails &heap, TADDR
ExtOut("Error requesting heap segment %p\n", SOS_PTR(taddrSeg));
return FALSE;
}
if (taddrObj >= TO_TADDR(dacpSeg.mem) && taddrObj && taddrObj < TO_TADDR(dacpSeg.allocated))
if (taddrObj >= TO_TADDR(dacpSeg.mem) && taddrObj < TO_TADDR(dacpSeg.allocated))
{
rngSeg.segAddr = (TADDR)dacpSeg.segmentAddr;
rngSeg.start = (TADDR)dacpSeg.mem;
Expand Down

0 comments on commit 55dd35d

Please sign in to comment.