From ff39f2a8fbe0dcb2dc4e969b06ffc9c3a7aff284 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Sun, 27 Mar 2016 12:48:58 +0100 Subject: [PATCH] Using rangecheck rather than checking base and limit ourselves. Copied from Perforce Change: 190447 ServerID: perforce.ravenbrook.com --- mps/code/cbs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mps/code/cbs.c b/mps/code/cbs.c index 0ec7bf98ca9..2e948b859ca 100644 --- a/mps/code/cbs.c +++ b/mps/code/cbs.c @@ -75,12 +75,13 @@ static Bool CBSBlockCheck(CBSBlock block) { UNUSED(block); /* Required because there is no signature */ CHECKL(block != NULL); + /* Can't use CHECKD_NOSIG because TreeEMPTY is NULL. */ CHECKL(TreeCheck(cbsBlockTree(block))); - /* If the block is in the middle of being deleted, */ - /* the pointers will be equal. */ - CHECKL(CBSBlockBase(block) <= CBSBlockLimit(block)); + /* If the block is in the middle of being deleted, the range might be empty. */ + CHECKD_NOSIG(Range, &block->rangeStruct); + /* Can't check maxSize because it may be invalid at the time */ return TRUE; }