Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Declare fake_stack only with ASan.
[simgrid.git] / src / kernel / context / ContextUnix.cpp
index b4af204..af76c2c 100644 (file)
@@ -143,7 +143,7 @@ void UContext::make_ctx(ucontext_t* ucp, void (*func)(int, int), UContext* arg)
 
 inline void UContext::swap(UContext* from, UContext* to)
 {
 
 inline void UContext::swap(UContext* from, UContext* to)
 {
-  void* fake_stack = nullptr;
+  ASAN_ONLY(void* fake_stack = nullptr);
   ASAN_ONLY(to->asan_ctx_ = from);
   ASAN_START_SWITCH(from->asan_stop_ ? nullptr : &fake_stack, to->asan_stack_, to->asan_stack_size_);
   swapcontext(&from->uc_, &to->uc_);
   ASAN_ONLY(to->asan_ctx_ = from);
   ASAN_START_SWITCH(from->asan_stop_ ? nullptr : &fake_stack, to->asan_stack_, to->asan_stack_size_);
   swapcontext(&from->uc_, &to->uc_);