Skip to content

Commit 86436e4

Browse files
authored
Merge pull request #324 from zhykzhykzhyk/patch-1
Ensure manage_exception_state uses correct TLS
2 parents 456f4b1 + 781a15e commit 86436e4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/boost/context/fiber_fcontext.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ struct __cxa_eh_globals {
8787

8888
class manage_exception_state {
8989
public:
90-
manage_exception_state() {
91-
exception_state_ = *__cxa_get_globals();
90+
BOOST_NOINLINE manage_exception_state() {
91+
exception_state_ = *(volatile __cxa_eh_globals *)__cxa_get_globals();
9292
}
93-
~manage_exception_state() {
94-
*__cxa_get_globals() = exception_state_;
93+
BOOST_NOINLINE ~manage_exception_state() {
94+
*(volatile __cxa_eh_globals *)__cxa_get_globals() = exception_state_;
9595
}
9696
private:
9797
__cxa_eh_globals exception_state_;

0 commit comments

Comments
 (0)