summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/include/future2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/include/future b/libcxx/include/future
index ce15eafbf7e..957a23cd8d9 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -1482,6 +1482,7 @@ template <class _Rp>
void
promise<_Rp>::set_exception(exception_ptr __p)
{
+ _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
@@ -1629,6 +1630,7 @@ template <class _Rp>
void
promise<_Rp&>::set_exception(exception_ptr __p)
{
+ _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
OpenPOWER on IntegriCloud