From fec5324502577f8e861e62a1a2377acd137086fe Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:50:37 -0500 Subject: [PATCH] Fix --- src/unwind/unwind_with_unwind.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/unwind/unwind_with_unwind.cpp b/src/unwind/unwind_with_unwind.cpp index f36b93d..c402bf8 100644 --- a/src/unwind/unwind_with_unwind.cpp +++ b/src/unwind/unwind_with_unwind.cpp @@ -32,7 +32,7 @@ namespace detail { } ASSERT( - state.vec.size() < state.max_frames, + state.vec.size() < state.max_depth, "Somehow cpptrace::detail::unwind_callback is being called beyond the max_depth" ); int is_before_instruction = 0; @@ -44,7 +44,7 @@ namespace detail { return _URC_END_OF_STACK; } else { state.vec.push_back(ip); - if(state.vec.size() >= state.max_frames) { + if(state.vec.size() >= state.max_depth) { return _URC_END_OF_STACK; } else { return _URC_NO_REASON; @@ -57,8 +57,6 @@ namespace detail { std::vector frames; unwind_state state{skip + 1, max_depth, frames}; _Unwind_Backtrace(unwind_callback, &state); // presumably thread-safe - frames.resize(state.count); - frames.shrink_to_fit(); return frames; }