diff options
Diffstat (limited to 'libstdc++-v3/include/std/stacktrace')
-rw-r--r-- | libstdc++-v3/include/std/stacktrace | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/stacktrace b/libstdc++-v3/include/std/stacktrace index 01e18ba..b9e260e 100644 --- a/libstdc++-v3/include/std/stacktrace +++ b/libstdc++-v3/include/std/stacktrace @@ -208,6 +208,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (_S_current(__cb, std::__addressof(__ret))) __ret._M_clear(); + else + __ret._M_trim(); } return __ret; } @@ -224,6 +226,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (_S_current(__cb, std::__addressof(__ret), __skip)) __ret._M_clear(); + else + __ret._M_trim(); } return __ret; @@ -260,6 +264,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } } + else + __ret._M_trim(); } return __ret; } @@ -651,6 +657,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; + void + _M_trim() noexcept + { + // libbacktrace adds an invalid -1UL entry at the end, remove it. + if (!empty() && !end()[-1]) + _M_impl._M_resize(size() - 1, _M_alloc); + } + [[no_unique_address]] allocator_type _M_alloc{}; _Impl _M_impl{}; |