Skip to content

Commit 09e0d71

Browse files
authored
[ubsan] Drop terminal "in " from reports without functions (#77163)
1 parent 2652243 commit 09e0d71

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler-rt/lib/ubsan/ubsan_diag.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static void MaybeReportErrorSummary(Location Loc, ErrorType Type) {
8888
AI.file = internal_strdup(SLoc.getFilename());
8989
AI.line = SLoc.getLine();
9090
AI.column = SLoc.getColumn();
91-
AI.function = internal_strdup(""); // Avoid printing ?? as function name.
91+
AI.function = nullptr;
9292
ReportErrorSummary(ErrorKind, AI, GetSanititizerToolName());
9393
AI.Clear();
9494
return;

compiler-rt/test/ubsan/TestCases/Misc/print_summary.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT
33
// RUN: %env_ubsan_opts=print_summary=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NO_SUMMARY
44

5-
// CHECK-DEFAULT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}}
6-
// CHECK-NO_SUMMARY-NOT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}}
5+
// CHECK-DEFAULT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}}print_summary.c{{[:0-9 ]*$}}
6+
// CHECK-NO_SUMMARY-NOT: SUMMARY: UndefinedBehaviorSanitizer:
77

88
int main(int argc, char **argv) {
99
int arr[argc - 2];

0 commit comments

Comments
 (0)