diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 46aa484..db74829 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -1922,7 +1922,9 @@ void eraseBetween(Node **inTree, Node256 *n, int begin, int end, } // Erase all nodes with a search path starting with n + [child], -// where child in [begin, end). +// where child in [begin, end). To avoid the need to propagate erases up the +// search path, the caller must ensure that the result has at least one child or +// has entryPresent. void eraseBetween(Node *&n, int begin, int end, WriteContext *tls) { #if DEBUG_VERBOSE && !defined(NDEBUG) fprintf(stderr, "eraseBetween: %s + [%d,%d)\n", @@ -1946,6 +1948,7 @@ void eraseBetween(Node *&n, int begin, int end, WriteContext *tls) { default: // GCOVR_EXCL_LINE __builtin_unreachable(); // GCOVR_EXCL_LINE } + assert(n->numChildren > 0 || n->entryPresent); } // Precondition: self is not the root. May invalidate nodes along the search