diff --git a/include/boost/coroutine/detail/symmetric_coroutine_impl.hpp b/include/boost/coroutine/detail/symmetric_coroutine_impl.hpp index 5293141..e1747cf 100644 --- a/include/boost/coroutine/detail/symmetric_coroutine_impl.hpp +++ b/include/boost/coroutine/detail/symmetric_coroutine_impl.hpp @@ -46,7 +46,6 @@ private: typedef parameters< R > param_type; int flags_; - exception_ptr except_; coroutine_context * caller_; coroutine_context * callee_; @@ -56,7 +55,6 @@ private: * callee_, reinterpret_cast< intptr_t >( to), preserve_fpu() ); - if ( except_) rethrow_exception( except_); } template< typename Other > @@ -78,7 +76,6 @@ public: coroutine_context * callee, bool unwind, bool preserve_fpu) : flags_( 0), - except_(), caller_( caller), callee_( callee) { @@ -199,7 +196,6 @@ private: typedef parameters< R & > param_type; int flags_; - exception_ptr except_; coroutine_context * caller_; coroutine_context * callee_; @@ -209,7 +205,6 @@ private: * callee_, reinterpret_cast< intptr_t >( to), preserve_fpu() ); - if ( except_) rethrow_exception( except_); } template< typename Other > @@ -231,7 +226,6 @@ public: coroutine_context * callee, bool unwind, bool preserve_fpu) : flags_( 0), - except_(), caller_( caller), callee_( callee) { @@ -344,7 +338,6 @@ private: typedef parameters< void > param_type; int flags_; - exception_ptr except_; coroutine_context * caller_; coroutine_context * callee_; @@ -366,7 +359,6 @@ public: coroutine_context * callee, bool unwind, bool preserve_fpu) : flags_( 0), - except_(), caller_( caller), callee_( callee) { @@ -411,7 +403,6 @@ public: * callee_, reinterpret_cast< intptr_t >( & to), preserve_fpu() ); - if ( except_) rethrow_exception( except_); } template< typename X > diff --git a/include/boost/coroutine/detail/trampoline.hpp b/include/boost/coroutine/detail/trampoline.hpp index 992026b..48740ba 100644 --- a/include/boost/coroutine/detail/trampoline.hpp +++ b/include/boost/coroutine/detail/trampoline.hpp @@ -8,6 +8,7 @@ #define BOOST_COROUTINES_DETAIL_TRAMPOLINE_H #include +#include #include #include @@ -66,7 +67,7 @@ void trampoline( intptr_t vp) catch ( forced_unwind const&) {} catch (...) - { c.except_ = current_exception(); } + { std::terminate(); } } c.flags_ |= flag_complete; @@ -107,7 +108,7 @@ void trampoline_void( intptr_t vp) catch ( forced_unwind const&) {} catch (...) - { c.except_ = current_exception(); } + { std::terminate(); } } c.flags_ |= flag_complete; diff --git a/test/test_symmetric_coroutine.cpp b/test/test_symmetric_coroutine.cpp index 0e04c65..933b60d 100644 --- a/test/test_symmetric_coroutine.cpp +++ b/test/test_symmetric_coroutine.cpp @@ -107,8 +107,6 @@ public: { value1 = state; } }; -struct my_exception {}; - void empty( coro::symmetric_coroutine< void >::self_type &) {} void f2( coro::symmetric_coroutine< void >::self_type &) @@ -437,26 +435,6 @@ void test_invalid_arg() BOOST_CHECK( value1); } -void test_exceptions() -{ - bool thrown = false; - std::runtime_error ex("abc"); - try - { - coro::symmetric_coroutine< void > coro( boost::bind( f9< std::runtime_error >, _1, ex) ); - BOOST_CHECK( coro); - coro(); - BOOST_CHECK( false); - } - catch ( std::runtime_error const&) - { thrown = true; } - catch ( std::exception const&) - {} - catch (...) - {} - BOOST_CHECK( thrown); -} - void test_yield_to_void() { value2 = 0; @@ -573,7 +551,6 @@ boost::unit_test::test_suite * init_unit_test_suite( int, char* []) test->add( BOOST_TEST_CASE( & test_termination) ); test->add( BOOST_TEST_CASE( & test_unwind) ); test->add( BOOST_TEST_CASE( & test_no_unwind) ); - test->add( BOOST_TEST_CASE( & test_exceptions) ); test->add( BOOST_TEST_CASE( & test_yield_to_void) ); test->add( BOOST_TEST_CASE( & test_yield_to_int) ); test->add( BOOST_TEST_CASE( & test_yield_to_ref) );