forked from weaselab/conflict-set
Run the maxVersion "borrowed range version" check
checkMaxVersion derived the key to look up from getSearchPath(root), but
`root` is the tree root, which is always the empty string. strinc("")
fails, so the block accounting for the range version of the first key
after the node's subtree never ran, for any node of any input, since it
was introduced in 9363d78. Use the node's own search path so the block
runs (and so `root` is left doing only what it was meant to do: being the
base of the search).
firstGeqLogical(), whose only caller is that block, dereferenced a null
sibling when the search key sorts after every key in the tree. It now
returns nullptr there, matching firstGeqPhysical().
Closes #95
This commit is contained in:
1 parent
e23018c952
commit
3d997d5c57
1 file changed
+6
-1
+6
-1
@@ -5631,6 +5631,9 @@ Node *firstGeqLogical(Node *n, const TrivialSpan key) {
|
||||
goto downLeftSpine;
|
||||
} else {
|
||||
n = nextSibling(n);
|
||||
if (n == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
goto downLeftSpine;
|
||||
}
|
||||
}
|
||||
@@ -5928,7 +5931,9 @@ checkMaxVersion(Node *root, Node *node, InternalVersionT oldestVersion,
|
||||
expected = std::max(expected, child->entry.rangeVersion);
|
||||
}
|
||||
}
|
||||
auto key = getSearchPath(root);
|
||||
// Account for the range version of the first key after `node`'s subtree: a
|
||||
// range write spanning the subtree is recorded there.
|
||||
auto key = getSearchPath(node);
|
||||
bool ok;
|
||||
auto inc = strinc(key, ok);
|
||||
if (ok) {
|
||||
|
||||
Reference in new issue
Block a user