aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1/functional
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2014-12-01 13:49:20 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2014-12-01 13:49:20 +0000
commit7b55fa54d4f8040c8f01acd3c725670000640538 (patch)
tree6d4a55ffd31c569daea99eed047d23e33962c50d /libstdc++-v3/include/tr1/functional
parent31a46aa7d4f7d810624d98547948833d7bba4756 (diff)
downloadgcc-7b55fa54d4f8040c8f01acd3c725670000640538.zip
gcc-7b55fa54d4f8040c8f01acd3c725670000640538.tar.gz
gcc-7b55fa54d4f8040c8f01acd3c725670000640538.tar.bz2
re PR libstdc++/63840 (std::function copy constructor deletes an uninitialized pointer if new fails)
PR libstdc++/63840 * include/std/functional (function::function(const function&)): Set _M_manager after operations that might throw. * include/tr1/functional (function::function(const function&), function::function(_Functor, _Useless)): Likewise. * testsuite/20_util/function/63840.cc: New. * testsuite/tr1/3_function_objects/function/63840.cc: New. From-SVN: r218215
Diffstat (limited to 'libstdc++-v3/include/tr1/functional')
-rw-r--r--libstdc++-v3/include/tr1/functional4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional
index 20785ff..58af9102 100644
--- a/libstdc++-v3/include/tr1/functional
+++ b/libstdc++-v3/include/tr1/functional
@@ -2112,9 +2112,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
if (static_cast<bool>(__x))
{
+ __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
_M_invoker = __x._M_invoker;
_M_manager = __x._M_manager;
- __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
}
}
@@ -2130,9 +2130,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
if (_My_handler::_M_not_empty_function(__f))
{
+ _My_handler::_M_init_functor(_M_functor, __f);
_M_invoker = &_My_handler::_M_invoke;
_M_manager = &_My_handler::_M_manager;
- _My_handler::_M_init_functor(_M_functor, __f);
}
}