@ -19,7 +19,7 @@
#include "absl/debugging/internal/vdso_support.h" // a no-op on non-elf or non-glibc systems
#include "absl/debugging/stacktrace.h"
static const uintptr _t kUnknownFrameSize = 0;
static const size _t kUnknownFrameSize = 0;
#if defined(__linux__)
// Returns the address of the VDSO __kernel_rt_sigreturn function, if present.
@ -65,11 +65,12 @@ static const unsigned char* GetKernelRtSigreturnAddress() {
// Compute the size of a stack frame in [low..high). We assume that
// low < high. Return size of kUnknownFrameSize .
template< typename T >
static inline uintptr _t ComputeStackFrameSize(const T* low,
const T* high) {
static inline size _t ComputeStackFrameSize(const T* low,
const T* high) {
const char* low_char_ptr = reinterpret_cast< const char * > (low);
const char* high_char_ptr = reinterpret_cast< const char * > (high);
return low < high ? high_char_ptr - low_char_ptr : kUnknownFrameSize ;
return low < high ? static_cast < size_t > (high_char_ptr - low_char_ptr)
: kUnknownFrameSize;
}
// Given a pointer to a stack frame, locate and return the calling
@ -117,8 +118,8 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc) {
// Check frame size. In strict mode, we assume frames to be under
// 100,000 bytes. In non-strict mode, we relax the limit to 1MB.
if (check_frame_size) {
const uintptr _t max_size = STRICT_UNWINDING ? 100000 : 1000000;
const uintptr _t frame_size =
const size _t max_size = STRICT_UNWINDING ? 100000 : 1000000;
const size _t frame_size =
ComputeStackFrameSize(old_frame_pointer, new_frame_pointer);
if (frame_size == kUnknownFrameSize || frame_size > max_size)
return nullptr;
@ -165,7 +166,8 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
} else {
result[n] = prev_return_address;
if (IS_STACK_FRAMES) {
sizes[n] = ComputeStackFrameSize(frame_pointer, next_frame_pointer);
sizes[n] = static_cast< int > (
ComputeStackFrameSize(frame_pointer, next_frame_pointer));
}
n++;
}