summaryrefslogtreecommitdiff
path: root/absl/debugging/internal/stacktrace_x86-inl.inc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/debugging/internal/stacktrace_x86-inl.inc')
-rw-r--r--absl/debugging/internal/stacktrace_x86-inl.inc12
1 files changed, 8 insertions, 4 deletions
diff --git a/absl/debugging/internal/stacktrace_x86-inl.inc b/absl/debugging/internal/stacktrace_x86-inl.inc
index 1b5d8235..1354cb37 100644
--- a/absl/debugging/internal/stacktrace_x86-inl.inc
+++ b/absl/debugging/internal/stacktrace_x86-inl.inc
@@ -140,13 +140,14 @@ static uintptr_t GetFP(const void *vuc) {
// TODO(bcmills): -momit-leaf-frame-pointer is currently the default
// behavior when building with clang. Talk to the C++ toolchain team about
// fixing that.
- if (bp >= sp && bp - sp <= kMaxFrameBytes) return bp;
+ if (bp >= sp && bp - sp <= kMaxFrameBytes)
+ return static_cast<uintptr_t>(bp);
// If bp isn't a plausible frame pointer, return the stack pointer instead.
// If we're lucky, it points to the start of a stack frame; otherwise, we'll
// get one frame of garbage in the stack trace and fail the sanity check on
// the next iteration.
- return sp;
+ return static_cast<uintptr_t>(sp);
}
#endif
return 0;
@@ -310,7 +311,8 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
int n = 0;
void **fp = reinterpret_cast<void **>(__builtin_frame_address(0));
- size_t stack_low = getpagesize(); // Assume that the first page is not stack.
+ // Assume that the first page is not stack.
+ size_t stack_low = static_cast<size_t>(getpagesize());
size_t stack_high = std::numeric_limits<size_t>::max() - sizeof(void *);
while (fp && n < max_depth) {
@@ -327,7 +329,9 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
result[n] = *(fp + 1);
if (IS_STACK_FRAMES) {
if (next_fp > fp) {
- sizes[n] = (uintptr_t)next_fp - (uintptr_t)fp;
+ sizes[n] = static_cast<int>(
+ reinterpret_cast<uintptr_t>(next_fp) -
+ reinterpret_cast<uintptr_t>(fp));
} else {
// A frame-size of 0 is used to indicate unknown frame size.
sizes[n] = 0;