Poison Node48 reverseIndex slot on erase

When a Node48 loses a child, the vacated reverseIndex slot would otherwise
remain defined, letting valgrind miss reads that rely on the stale value.
Mark it undefined, mirroring the existing poisoning of the vacated children
slot.
This commit is contained in:
2026-08-03 17:38:21 -04:00
parent bae2b22e95
commit 6d9810fe7f
+2
View File
@@ -2025,6 +2025,8 @@ Node *erase(Node *self, WriteContext *writeContext, bool logical) {
parent48->childMaxVersion[lastChildrenIndex] = writeContext->zero; parent48->childMaxVersion[lastChildrenIndex] = writeContext->zero;
VALGRIND_MAKE_MEM_UNDEFINED(parent48->children + lastChildrenIndex, VALGRIND_MAKE_MEM_UNDEFINED(parent48->children + lastChildrenIndex,
sizeof(parent48->children[0])); sizeof(parent48->children[0]));
VALGRIND_MAKE_MEM_UNDEFINED(parent48->reverseIndex + lastChildrenIndex,
sizeof(parent48->reverseIndex[0]));
if (needsDownsize(parent48)) { if (needsDownsize(parent48)) {
downsize(parent48, writeContext); downsize(parent48, writeContext);