X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d7fb52aa1f18cd70a51a6d8913c1a4513fea7ce7..2d37e348a09783cda723c7019640ee69de168324:/src/kernel/context/ContextRaw.cpp diff --git a/src/kernel/context/ContextRaw.cpp b/src/kernel/context/ContextRaw.cpp index 3b2906237b..84d742c45c 100644 --- a/src/kernel/context/ContextRaw.cpp +++ b/src/kernel/context/ContextRaw.cpp @@ -194,16 +194,11 @@ Context* RawContextFactory::create_context(std::function code, void_pfn_ // RawContext -RawContext::RawContext(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process, +RawContext::RawContext(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t actor, SwappedContextFactory* factory) - : SwappedContext(std::move(code), cleanup, process, factory) + : SwappedContext(std::move(code), cleanup, actor, factory) { if (has_code()) { -#if PTH_STACKGROWTH == -1 - ASAN_ONLY(this->asan_stack_ = static_cast(get_stack()) + smx_context_usable_stack_size); -#else - ASAN_ONLY(this->asan_stack_ = get_stack()); -#endif this->stack_top_ = raw_makecontext(get_stack(), smx_context_usable_stack_size, RawContext::wrapper, this); } else { if (MC_is_active()) @@ -217,14 +212,13 @@ void RawContext::wrapper(void* arg) ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_); try { (*context)(); + context->Context::stop(); } catch (StopRequest const&) { XBT_DEBUG("Caught a StopRequest"); } catch (simgrid::Exception const& e) { XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get()); throw; } - context->Context::stop(); - ASAN_ONLY(context->asan_stop_ = true); context->suspend(); }