From ded6e7fc2c2eea29539f921043e42a9fc16b32cc Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Tue, 6 Aug 2024 17:59:38 -0700 Subject: [PATCH] Require entry present for fixupMaxVersion --- ConflictSet.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index fd12555..ec0d79e 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -3049,13 +3049,11 @@ void addPointWrite(Node *&root, std::span key, } } +// Precondition: `node->entryPresent` void fixupMaxVersion(Node *node, ConflictSet::Impl *impl, WriteContext *tls) { InternalVersionT max; - if (node->entryPresent) { - max = std::max(node->entry.pointVersion, tls->zero); - } else { - max = tls->zero; - } + assert(node->entryPresent); + max = std::max(node->entry.pointVersion, tls->zero); switch (node->getType()) { case Type_Node0: break;