Skip to content

Commit c7e4065

Browse files
authored
[NFC][sanitizer] Add consts to SkipInternalFrames (llvm#77162)
1 parent 23aabdd commit c7e4065

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ void ReportErrorSummary(const char *error_type, const AddressInfo &info,
395395
void ReportErrorSummary(const char *error_type, const StackTrace *trace,
396396
const char *alt_tool_name = nullptr);
397397
// Skips frames which we consider internal and not usefull to the users.
398-
SymbolizedStack *SkipInternalFrames(SymbolizedStack *frames);
398+
const SymbolizedStack *SkipInternalFrames(const SymbolizedStack *frames);
399399

400400
void ReportMmapWriteExec(int prot, int mflags);
401401

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
4141
return false;
4242
}
4343

44-
SymbolizedStack *SkipInternalFrames(SymbolizedStack *frames) {
45-
for (SymbolizedStack *f = frames; f; f = f->next)
44+
const SymbolizedStack *SkipInternalFrames(const SymbolizedStack *frames) {
45+
for (const SymbolizedStack *f = frames; f; f = f->next)
4646
if (!FrameIsInternal(f))
4747
return f;
4848
return nullptr;

compiler-rt/lib/tsan/rtl/tsan_report.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ static ReportStack *ChooseSummaryStack(const ReportDesc *rep) {
273273
return 0;
274274
}
275275

276-
static SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) {
277-
if (SymbolizedStack *f = SkipInternalFrames(frames))
276+
static const SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) {
277+
if (const SymbolizedStack *f = SkipInternalFrames(frames))
278278
return f;
279279
return frames; // Fallback to the top frame.
280280
}
@@ -350,7 +350,7 @@ void PrintReport(const ReportDesc *rep) {
350350
Printf(" And %d more similar thread leaks.\n\n", rep->count - 1);
351351

352352
if (ReportStack *stack = ChooseSummaryStack(rep)) {
353-
if (SymbolizedStack *frame = SkipTsanInternalFrames(stack->frames))
353+
if (const SymbolizedStack *frame = SkipTsanInternalFrames(stack->frames))
354354
ReportErrorSummary(rep_typ_str, frame->info);
355355
}
356356

0 commit comments

Comments
 (0)