forked from weaselab/conflict-set
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:
@@ -2025,6 +2025,8 @@ Node *erase(Node *self, WriteContext *writeContext, bool logical) {
|
||||
parent48->childMaxVersion[lastChildrenIndex] = writeContext->zero;
|
||||
VALGRIND_MAKE_MEM_UNDEFINED(parent48->children + lastChildrenIndex,
|
||||
sizeof(parent48->children[0]));
|
||||
VALGRIND_MAKE_MEM_UNDEFINED(parent48->reverseIndex + lastChildrenIndex,
|
||||
sizeof(parent48->reverseIndex[0]));
|
||||
|
||||
if (needsDownsize(parent48)) {
|
||||
downsize(parent48, writeContext);
|
||||
|
||||
Reference in New Issue
Block a user