-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[NFC][sanitizer] Add consts to SkipInternalFrames #77162
Merged
vitalybuka
merged 6 commits into
main
from
users/vitalybuka/spr/nfcsanitizer-add-consts-to-skipinternalframes
Jan 6, 2024
Merged
[NFC][sanitizer] Add consts to SkipInternalFrames #77162
vitalybuka
merged 6 commits into
main
from
users/vitalybuka/spr/nfcsanitizer-add-consts-to-skipinternalframes
Jan 6, 2024
Conversation
This file contains 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
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) ChangesFull diff: https://github.com/llvm/llvm-project/pull/77162.diff 3 Files Affected:
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
index 7d9d61de8b6175..b99c0cffcbb116 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -395,7 +395,7 @@ void ReportErrorSummary(const char *error_type, const AddressInfo &info,
void ReportErrorSummary(const char *error_type, const StackTrace *trace,
const char *alt_tool_name = nullptr);
// Skips frames which we consider internal and not usefull to the users.
-SymbolizedStack *SkipInternalFrames(SymbolizedStack *frames);
+const SymbolizedStack *SkipInternalFrames(const SymbolizedStack *frames);
void ReportMmapWriteExec(int prot, int mflags);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
index 26f015e70d0405..0cf250f7212943 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
@@ -41,8 +41,8 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
return false;
}
-SymbolizedStack *SkipInternalFrames(SymbolizedStack *frames) {
- for (SymbolizedStack *f = frames; f; f = f->next)
+const SymbolizedStack *SkipInternalFrames(const SymbolizedStack *frames) {
+ for (const SymbolizedStack *f = frames; f; f = f->next)
if (!FrameIsInternal(f))
return f;
return nullptr;
diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
index b1cee7ac8cbf83..22ba428cc58b77 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
@@ -273,8 +273,8 @@ static ReportStack *ChooseSummaryStack(const ReportDesc *rep) {
return 0;
}
-static SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) {
- if (SymbolizedStack *f = SkipInternalFrames(frames))
+static const SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) {
+ if (const SymbolizedStack *f = SkipInternalFrames(frames))
return f;
return frames; // Fallback to the top frame.
}
@@ -350,7 +350,7 @@ void PrintReport(const ReportDesc *rep) {
Printf(" And %d more similar thread leaks.\n\n", rep->count - 1);
if (ReportStack *stack = ChooseSummaryStack(rep)) {
- if (SymbolizedStack *frame = SkipTsanInternalFrames(stack->frames))
+ if (const SymbolizedStack *frame = SkipTsanInternalFrames(stack->frames))
ReportErrorSummary(rep_typ_str, frame->info);
}
|
Created using spr 1.3.4 [skip ci]
kstoimenov
approved these changes
Jan 6, 2024
Created using spr 1.3.4 [skip ci]
justinfargnoli
pushed a commit
to justinfargnoli/llvm-project
that referenced
this pull request
Jan 28, 2024
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.
No description provided.