{{ message }}
Fix shouldPatchFunction false negative when match is inside template args#101885
Merged
pamarcos merged 3 commits intoApr 8, 2026
Merged
Conversation
…args shouldPatchFunction used std::string::find() which returns only the first match. If that match was inside template <...> arguments, the function returned false without searching for subsequent occurrences that might be outside template arguments. Loop over all occurrences instead of stopping at the first one. Also replace std::stack<bool> with a simple depth counter to avoid undefined behavior from popping an empty stack on malformed >. Closes ClickHouse#101808
Contributor
Member
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
Algunenano
approved these changes
Apr 7, 2026
Member
|
The test |
Contributor
LLVM Coverage ReportChanged lines: 100.00% (26/26) | lost baseline coverage: 1 line(s) · Uncovered code |
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.

shouldPatchFunctionusedstd::string::findwhich returns only the first match. If that first match was inside template<...>arguments, the function returnedfalsewithout searching for subsequent occurrences that might be outside template arguments.The fix loops over all occurrences of the search string instead of stopping at the first one. It also replaces
std::stack<bool>with a simple depth counter, which avoids undefined behavior from popping an empty stack on a stray>.Closes #101808
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
shouldPatchFunctionfalse negative inSYSTEM INSTRUMENT ADDwhen the search string first appears inside a template argument of the demangled symbol name.Documentation entry for user-facing changes
Version info
26.4.1.653