X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/772b27f677a94b83523c0b44e018f1feb4b558ef..cb5c0fb6bd81952456a54789b6ad1d570067ae80:/src/kernel/context/ContextSwapped.hpp diff --git a/src/kernel/context/ContextSwapped.hpp b/src/kernel/context/ContextSwapped.hpp index c495b34b70..cabea51f29 100644 --- a/src/kernel/context/ContextSwapped.hpp +++ b/src/kernel/context/ContextSwapped.hpp @@ -57,6 +57,10 @@ public: bool asan_stop_ = false; #endif +protected: + // With ASan, after a context switch, check that the originating context is the expected one (see BoostContext) + void verify_previous_context(const SwappedContext* context) const; + private: static thread_local SwappedContext* worker_context_; @@ -68,6 +72,13 @@ private: #endif }; +inline void SwappedContext::verify_previous_context(XBT_ATTRIB_UNUSED const SwappedContext* context) const +{ +#if HAVE_SANITIZER_ADDRESS_FIBER_SUPPORT + xbt_assert(this->asan_ctx_ == context); +#endif +} + } // namespace context } // namespace kernel } // namespace simgrid