aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'util/system/context.cpp')
-rw-r--r--util/system/context.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/util/system/context.cpp b/util/system/context.cpp
index ad99309088..3a67593813 100644
--- a/util/system/context.cpp
+++ b/util/system/context.cpp
@@ -134,6 +134,8 @@ namespace {
#endif
}
+ #if defined(USE_SANITIZER_CONTEXT)
+
TContMachineContext::TSan::TSan() noexcept
: TL(nullptr)
{
@@ -148,11 +150,12 @@ TContMachineContext::TSan::TSan(const TContClosure& c) noexcept
void TContMachineContext::TSan::DoRunNaked() {
AfterSwitch();
TL->DoRunNaked();
- BeforeFinish();
}
+ #endif
+
TContMachineContext::TContMachineContext(const TContClosure& c)
- #if defined(_asan_enabled_) || defined(_tsan_enabled_)
+ #if defined(USE_SANITIZER_CONTEXT)
: San_(c)
#endif
{
@@ -162,7 +165,7 @@ TContMachineContext::TContMachineContext(const TContClosure& c)
* arg, and align data
*/
- #if defined(_asan_enabled_)
+ #if defined(USE_SANITIZER_CONTEXT)
auto trampoline = &San_;
#else
auto trampoline = c.TrampoLine;
@@ -196,12 +199,12 @@ TContMachineContext::TContMachineContext(const TContClosure& c)
void TContMachineContext::SwitchTo(TContMachineContext* next) noexcept {
if (Y_LIKELY(__mysetjmp(Buf_) == 0)) {
- #if defined(_asan_enabled_) || defined(_tsan_enabled_)
+ #if defined(USE_SANITIZER_CONTEXT)
next->San_.BeforeSwitch(&San_);
#endif
__mylongjmp(next->Buf_, 1);
} else {
- #if defined(_asan_enabled_)
+ #if defined(USE_SANITIZER_CONTEXT)
San_.AfterSwitch();
#endif
}