-
Notifications
You must be signed in to change notification settings - Fork 14k
[UBSan] Support src:*=sanitize for multiple ignorelists. #141640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
qinkunbao
merged 11 commits into
main
from
users/qinkunbao/spr/ubsan-support-srcsanitize-for-multiple-ignorelists
May 28, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d858fbe
[𝘀𝗽𝗿] changes to main this commit is based on
qinkunbao 5fe858d
[𝘀𝗽𝗿] initial version
qinkunbao cddba02
Add some comments.
qinkunbao 468bc10
Update tests.
qinkunbao fe466eb
Merge branch 'main' into users/qinkunbao/spr/ubsan-support-srcsanitiz…
qinkunbao b454bb1
Fix some errors.
qinkunbao 260bf5d
fix a typo
qinkunbao 8732a7a
Fix inSectionBlame
qinkunbao 5b6ba2c
Fix the build
qinkunbao 12b023f
Fix comments
qinkunbao 1fe3de7
Merge branch 'main' into users/qinkunbao/spr/ubsan-support-srcsanitiz…
qinkunbao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this is almost an anti-pattern, using std::pair like this. We have two opaque values that we now have to go back to the function to understand what they mean.
If you had a type (class) with two members (
FileIdx
andLineNo
) then it would make sense at each use as opposed tofirst
andsecond
which is not informative.I actually don't see the values explicitly used but I am assuming they will be in a later change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLVM code is full of them, and here they should not be exposed beyond NoSanitizeList, so I ignore on review.
But I will not argue if you are asking to improve.
It's used for comparison "return NoSan > San" in NoSanitizeList::containsFile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't insist, but if we won't actually (maybe I am misunderstanding) use the value stored in the pair then a flag makes way more sense. Otherwise, having to use
first
andsecond
is just prone to error.I do get that this is local and that we (llvm) is not free of anti-patterns but we should strive to do better in new code. One because future new users might use this to learn and outside developers (even LLMs) will learn this is a good pattern and propagate its use.