File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler-rt/lib/scudo/standalone Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1610,8 +1610,12 @@ class Allocator {
1610
1610
// is very important.
1611
1611
RB->RawStackDepotMap .unmap (RB->RawStackDepotMap .getBase (),
1612
1612
RB->RawStackDepotMap .getCapacity ());
1613
- RB->RawRingBufferMap .unmap (RB->RawRingBufferMap .getBase (),
1614
- RB->RawRingBufferMap .getCapacity ());
1613
+ // Note that the `RB->RawRingBufferMap` is stored on the pages managed by
1614
+ // itself. Take over the ownership before calling unmap() so that any
1615
+ // operation along with unmap() won't touch inaccessible pages.
1616
+ MemMapT RawRingBufferMap = RB->RawRingBufferMap ;
1617
+ RawRingBufferMap.unmap (RawRingBufferMap.getBase (),
1618
+ RawRingBufferMap.getCapacity ());
1615
1619
atomic_store (&RingBufferAddress, 0 , memory_order_release);
1616
1620
}
1617
1621
You can’t perform that action at this time.
0 commit comments