Skip to content

Commit 087c47f

Browse files
committed
[PR] fmayer - Test for true, fix name of function
1 parent fd09907 commit 087c47f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

compiler-rt/lib/rtsan/rtsan.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static InitializationState GetInitializationState() {
4444
atomic_load(&rtsan_initialized, memory_order_acquire));
4545
}
4646

47-
static auto DefaultErrorAction(DiagnosticsInfo info) {
47+
static auto OnViolationAction(DiagnosticsInfo info) {
4848
return [info]() {
4949
__rtsan::PrintDiagnostics(info);
5050
if (flags().halt_on_error)
@@ -107,17 +107,17 @@ __rtsan_notify_intercepted_call(const char *func_name) {
107107
__rtsan_ensure_initialized();
108108
GET_CALLER_PC_BP;
109109
ExpectNotRealtime(GetContextForThisThread(),
110-
DefaultErrorAction({DiagnosticsInfoType::InterceptedCall,
111-
func_name, pc, bp}));
110+
OnViolationAction({DiagnosticsInfoType::InterceptedCall,
111+
func_name, pc, bp}));
112112
}
113113

114114
SANITIZER_INTERFACE_ATTRIBUTE void
115115
__rtsan_notify_blocking_call(const char *func_name) {
116116
__rtsan_ensure_initialized();
117117
GET_CALLER_PC_BP;
118118
ExpectNotRealtime(GetContextForThisThread(),
119-
DefaultErrorAction({DiagnosticsInfoType::BlockingCall,
120-
func_name, pc, bp}));
119+
OnViolationAction({DiagnosticsInfoType::BlockingCall,
120+
func_name, pc, bp}));
121121
}
122122

123123
} // extern "C"

compiler-rt/test/rtsan/halt_on_error.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clangxx -fsanitize=realtime %s -o %t
2-
// RUN: env RTSAN_OPTIONS="halt_on_error=false" %run %t 2>&1 | FileCheck %s
2+
// RUN: %env_rtsan_opts="halt_on_error=true" not %run %t 2>&1 | FileCheck %s
3+
// RUN: %env_rtsan_opts="halt_on_error=false" %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-HALT,CHECK
34
// UNSUPPORTED: ios
45

56
// Intent: Ensure that halt_on_error does not exit on the first violation.
@@ -20,6 +21,6 @@ int main() {
2021
return 0;
2122
// CHECK: ==ERROR: RealtimeSanitizer
2223
// CHECK-NEXT: {{.*`malloc`.*}}
23-
// CHECK: ==ERROR: RealtimeSanitizer
24-
// CHECK-NEXT: {{.*`free`.*}}
24+
// CHECK-NO-HALT: ==ERROR: RealtimeSanitizer
25+
// CHECK-NO-HALT-NEXT: {{.*`free`.*}}
2526
}

0 commit comments

Comments
 (0)