Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Use unsigned char* for context stacks.
[simgrid.git] / src / kernel / context / ContextBoost.cpp
index b1deb29..95743c6 100644 (file)
@@ -31,9 +31,9 @@ BoostContext::BoostContext(std::function<void()> code, smx_actor_t actor, Swappe
     /* We need to pass the bottom of the stack to make_fcontext,
        depending on the stack direction it may be the lower or higher address: */
 #if PTH_STACKGROWTH == -1
     /* We need to pass the bottom of the stack to make_fcontext,
        depending on the stack direction it may be the lower or higher address: */
 #if PTH_STACKGROWTH == -1
-    void* stack = static_cast<char*>(get_stack()) + smx_context_usable_stack_size;
+    unsigned char* stack = get_stack() + smx_context_usable_stack_size;
 #else
 #else
-    void* stack = get_stack();
+    unsigned char* stack = get_stack();
 #endif
 #if BOOST_VERSION < 106100
     this->fc_ = boost::context::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper);
 #endif
 #if BOOST_VERSION < 106100
     this->fc_ = boost::context::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper);
@@ -69,8 +69,8 @@ void BoostContext::wrapper(BoostContext::arg_type arg)
   try {
     (*context)();
     context->Context::stop();
   try {
     (*context)();
     context->Context::stop();
-  } catch (StopRequest const&) {
-    XBT_DEBUG("Caught a StopRequest");
+  } catch (ForcefulKillException const&) {
+    XBT_DEBUG("Caught a ForcefulKillException");
   } catch (simgrid::Exception const& e) {
     XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
     throw;
   } catch (simgrid::Exception const& e) {
     XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
     throw;