Fix some bugs. Still buggy. Keep fuzzing
This commit is contained in:
@@ -560,10 +560,10 @@ Node *nextSibling(Node *node, Vector<uint8_t> &searchPath) {
|
|||||||
}
|
}
|
||||||
auto next = getChildGeq(node->parent, node->parentsIndex + 1);
|
auto next = getChildGeq(node->parent, node->parentsIndex + 1);
|
||||||
if (next < 0) {
|
if (next < 0) {
|
||||||
|
searchPath.resize(int(searchPath.size()) - (1 + node->partialKeyLen));
|
||||||
node = node->parent;
|
node = node->parent;
|
||||||
searchPath.resize(int(searchPath.size()) - 1 - node->partialKeyLen);
|
|
||||||
} else {
|
} else {
|
||||||
searchPath.resize(int(searchPath.size()) - 1 - node->partialKeyLen);
|
searchPath.resize(int(searchPath.size()) - (1 + node->partialKeyLen));
|
||||||
auto *result = getChildExists(node->parent, next);
|
auto *result = getChildExists(node->parent, next);
|
||||||
searchPath.push_back(next);
|
searchPath.push_back(next);
|
||||||
searchPath.insert(searchPath.end(), result->partialKey,
|
searchPath.insert(searchPath.end(), result->partialKey,
|
||||||
@@ -828,7 +828,14 @@ bool checkRangeRead(Node *n, const std::span<const uint8_t> begin,
|
|||||||
|
|
||||||
for (auto *iter = nextPhysical(left.n, searchPath); iter != right.n;) {
|
for (auto *iter = nextPhysical(left.n, searchPath); iter != right.n;) {
|
||||||
assert(searchPath == getSearchPath(arena, iter));
|
assert(searchPath == getSearchPath(arena, iter));
|
||||||
|
if (iter->entryPresent && iter->entry.rangeVersion > readVersion) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
#if DEBUG_VERBOSE && !defined(NDEBUG)
|
||||||
|
fprintf(stderr, "Max version of keys starting with %s: %" PRId64 "\n",
|
||||||
|
printable(searchPath).c_str(), iter->maxVersion);
|
||||||
|
#endif
|
||||||
auto rangeEnd = strincMutate(searchPath, ok);
|
auto rangeEnd = strincMutate(searchPath, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return iter->maxVersion <= readVersion;
|
return iter->maxVersion <= readVersion;
|
||||||
|
Reference in New Issue
Block a user