diff --git a/include/boost/context/fiber_fcontext.hpp b/include/boost/context/fiber_fcontext.hpp index 2c91b110..67717edf 100644 --- a/include/boost/context/fiber_fcontext.hpp +++ b/include/boost/context/fiber_fcontext.hpp @@ -87,11 +87,11 @@ struct __cxa_eh_globals { class manage_exception_state { public: - manage_exception_state() { - exception_state_ = *__cxa_get_globals(); + BOOST_NOINLINE manage_exception_state() { + exception_state_ = *(volatile __cxa_eh_globals *)__cxa_get_globals(); } - ~manage_exception_state() { - *__cxa_get_globals() = exception_state_; + BOOST_NOINLINE ~manage_exception_state() { + *(volatile __cxa_eh_globals *)__cxa_get_globals() = exception_state_; } private: __cxa_eh_globals exception_state_;