Repository navigation
fix: bugs found during cleanup - #4
Merged
Merged
Conversation
added 9 commits
October 4, 2026 16:09
A merge left the frame loop in trace_string twice. Also print all frames instead of dropping the last two (only matched msvc's main thread, undefined for shorter traces) and skip frames without a description.
Same rule as assert. Only msvc defines _DEBUG, gcc and clang debug builds hit the "neither CTH_DEBUG_MODE nor CTH_RELEASE_MODE" error.
realloc overwrote the pointer to the old block, every copy assignment leaked it.
It returned a copy of the pointee, so *ptr = x did not compile and non-copyable pointees could not be dereferenced.
1 << id shifted an int: id 31 produced a sign extended value, id >= 32 was undefined.
It re-parented the listed nodes instead of their roots, so nodes already in another set left that set behind, and the set size only grew by one per node.
Adds reasons to the vcpkg assertions of the toolchain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
exception.hpp: stack frames were printed twice (left over from a merge),end() - 2dropped frames that are only runtime frames on msvc's main thread and was undefined for short traces. Now prints all frames that have a description.constants.hpp: gcc and clang debug builds hit the "neither CTH_DEBUG_MODE nor CTH_RELEASE_MODE" error. Debug mode now defaults likeassert(noNDEBUG= debug),gcc_debugpreset added.poly_vector:reallocleaked the previous block on every copy assignment (found with AddressSanitizer).move_ptr::operator*returned a copy:*ptr = xdid not compile, non-copyable pointees could not be dereferenced.flag_val:1 << idshifted anint, id 31 was sign extended, id >= 32 undefined.union_find::merge(group_t)re-parented nodes instead of their roots, sets were not merged and sizes were wrong. Regression test added.lib/cth_cmake: toolchain assertions now say what is missing (VCPKG_ROOT/ vcpkg).