Check that all children have reachable present entries
This commit is contained in:
@@ -1173,11 +1173,28 @@ void checkParentPointers(Node *node, bool &success) {
|
||||
return expected;
|
||||
}
|
||||
|
||||
[[maybe_unused]] int64_t checkEntriesExist(Node *node, bool &success) {
|
||||
int64_t total = node->entryPresent;
|
||||
for (int i = getChildGeq(node, 0); i >= 0; i = getChildGeq(node, i + 1)) {
|
||||
auto *child = getChildExists(node, i);
|
||||
int64_t e = checkEntriesExist(child, success);
|
||||
total += e;
|
||||
if (e == 0) {
|
||||
Arena arena;
|
||||
fprintf(stderr, "%s has child %02x with no reachable entries\n",
|
||||
printable(getSearchPath(arena, node)).c_str(), i);
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
bool checkCorrectness(Node *node, ReferenceImpl &refImpl) {
|
||||
bool success = true;
|
||||
|
||||
checkParentPointers(node, success);
|
||||
checkMaxVersion(node, success);
|
||||
checkEntriesExist(node, success);
|
||||
|
||||
std::string logicalMap;
|
||||
std::string referenceLogicalMap;
|
||||
|
Reference in New Issue
Block a user