Fix move-assignment leak and self-assignment in ConflictSet #55

Merged
andrew merged 1 commits from weaselbot/conflict-set:weaselbot/issue-54 into main 2026-06-22 18:40:27 +00:00
Member

Closes #54

The move-assignment operator in all three implementations now destroys the existing impl before taking ownership of other.impl, and guards against self-move-assignment.

Closes #54 The move-assignment operator in all three implementations now destroys the existing `impl` before taking ownership of `other.impl`, and guards against self-move-assignment.
andrew added 1 commit 2026-06-22 18:09:03 +00:00
Fix self-move-assignment and leak in ConflictSet move-assignment
CI / release (arm64, ubuntu-latest-arm64) (pull_request) Successful in 3m23s
CI / pre-commit (pull_request) Successful in 2m5s
CI / test (-DCMAKE_BUILD_TYPE=Debug, debug) (pull_request) Successful in 3m36s
CI / test (-DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 64-bit-versions) (pull_request) Successful in 3m28s
CI / test (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc) (pull_request) Successful in 3m38s
CI / test (-DUSE_SIMD_FALLBACK=ON, simd-fallback) (pull_request) Successful in 3m28s
CI / release (amd64, ubuntu-latest-amd64) (pull_request) Successful in 4m53s
CI / coverage (pull_request) Successful in 3m38s
4dc5f7f75c
The user-declared move-assignment operator overwrote `impl` without first
destroying the existing implementation object, leaking all memory and resources
owned by the left-hand side. Self-move-assignment also set `impl` to nullptr,
leaving the object invalid and leaking the old state.

Fix all three implementations (ConflictSet.cpp, SkipList.cpp, HashTable.cpp)
to guard against self-assignment and to destroy/free the old `impl` before
taking ownership of `other.impl`.
andrew force-pushed weaselbot/issue-54 from 2431f7db8a to 4dc5f7f75c 2026-06-22 18:09:03 +00:00 Compare
andrew merged commit f30887f280 into main 2026-06-22 18:40:27 +00:00
andrew deleted branch weaselbot/issue-54 2026-06-22 18:40:27 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weaselab/conflict-set#55