Skip to content

Commit 06321b5

Browse files
committed
Make sure rtsan gets initialized on mac
1 parent 25897ba commit 06321b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/lib/rtsan/rtsan_interceptors.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939

4040
using namespace __sanitizer;
4141

42-
using __rtsan::rtsan_init_is_running;
4342
using __rtsan::rtsan_initialized;
4443

4544
namespace {
@@ -49,6 +48,9 @@ struct DlsymAlloc : public DlSymAllocator<DlsymAlloc> {
4948
} // namespace
5049

5150
void ExpectNotRealtime(const char *intercepted_function_name) {
51+
if (!rtsan_initialized)
52+
__rtsan_init();
53+
5254
__rtsan::GetContextForThisThread().ExpectNotRealtime(
5355
intercepted_function_name);
5456
}

0 commit comments

Comments
 (0)