From 9eb9063e800090891b93fb7a74e0cb17dc579dc8 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 10 Feb 2016 15:14:21 +0000 Subject: [PATCH] Ensuring landfinish doesn't try treecheck on unmapped memory. see . Copied from Perforce Change: 189121 ServerID: perforce.ravenbrook.com --- mps/code/arena.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mps/code/arena.c b/mps/code/arena.c index cf65402b4e6..738761aaa33 100644 --- a/mps/code/arena.c +++ b/mps/code/arena.c @@ -417,6 +417,11 @@ static void arenaFreeLandFinish(Arena arena) AVERT(Arena, arena); AVER(arena->hasFreeLand); + /* We're about to free the memory occupied by the free land, which + contains a CBS. We want to make sure that LandFinish doesn't try + to check the CBS, so nuke it here. TODO: LandReset? */ + arena->freeLandStruct.splayTreeStruct.root = TreeEMPTY; + /* The CBS block pool can't free its own memory via ArenaFree because * that would use the free land. */ MFSFinishTracts(ArenaCBSBlockPool(arena), arenaMFSPageFreeVisitor,