From b564087208b265abc3fc2af3f862c69bfe56452d Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Thu, 24 Nov 2016 09:34:49 +0300 Subject: [PATCH] Make Linux version of detail::backtrace_holder look exactly as the Windows version --- include/boost/stacktrace/detail/backend_linux.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/stacktrace/detail/backend_linux.hpp b/include/boost/stacktrace/detail/backend_linux.hpp index 3cd3b95..90d0c9c 100644 --- a/include/boost/stacktrace/detail/backend_linux.hpp +++ b/include/boost/stacktrace/detail/backend_linux.hpp @@ -25,7 +25,7 @@ namespace boost { namespace stacktrace { namespace detail { struct backtrace_holder { std::size_t frames_count; - void* buffer[1]; + void* buffer[]; backtrace_holder() BOOST_NOEXCEPT {} @@ -44,7 +44,7 @@ backend::backend(void* memory, std::size_t size, std::size_t& hash_code) BOOST_N hash_code = 0; // TODO: Not async signal safe. Use _Unwind_Backtrace, _Unwind_GetIP - impl().frames_count = ::backtrace(impl().buffer, 1 + (size - sizeof(backtrace_holder)) / sizeof(void*)); + impl().frames_count = ::backtrace(impl().buffer, (size - sizeof(backtrace_holder)) / sizeof(void*)); if (impl().buffer[impl().frames_count - 1] == 0) { -- impl().frames_count; }