@@ -70,10 +70,8 @@ BUTIL_FORCE_INLINE void FinishSwitchFiber(void* fake_stack_save) {
7070
7171class ScopedASanFiberSwitcher {
7272public:
73- ScopedASanFiberSwitcher (bool cur_ending, StackStorage& next_storage) {
74- // If the current bthread will be quit here, pass NULL as `fake_stack_save',
75- // so that ASan knows it can destroy the fake stack.
76- StartSwitchFiber (cur_ending ? NULL : &_fake_stack, next_storage);
73+ ScopedASanFiberSwitcher (StackStorage& next_storage) {
74+ StartSwitchFiber (&_fake_stack, next_storage);
7775 }
7876
7977 ~ScopedASanFiberSwitcher () {
@@ -92,16 +90,16 @@ class ScopedASanFiberSwitcher {
9290#define BTHREAD_ASAN_UNPOISON_MEMORY_REGION (storage ) \
9391 ::bthread::internal::ASanUnpoisonMemoryRegion (storage)
9492
95- #define BTHREAD_SCOPED_ASAN_FIBER_SWITCHER (storage, ending ) \
96- ::bthread::internal::ScopedASanFiberSwitcher switcher (storage, ending )
93+ #define BTHREAD_SCOPED_ASAN_FIBER_SWITCHER (storage ) \
94+ ::bthread::internal::ScopedASanFiberSwitcher switcher (storage)
9795
9896} // namespace internal
9997#else
10098
10199// If ASan are used, the annotations should be no-ops.
102100#define BTHREAD_ASAN_POISON_MEMORY_REGION (storage ) ((void )(storage))
103101#define BTHREAD_ASAN_UNPOISON_MEMORY_REGION (storage ) ((void )(storage))
104- #define BTHREAD_SCOPED_ASAN_FIBER_SWITCHER (storage, ending ) ((void )(storage), ( void )(ending ))
102+ #define BTHREAD_SCOPED_ASAN_FIBER_SWITCHER (storage ) ((void )(storage))
105103
106104#endif // BUTIL_USE_ASAN
107105
0 commit comments