diff options
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc index 7525895ab83..109a674e45b 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc @@ -25,10 +25,7 @@ static const char *StripPathPrefix(const char *filepath, } // ----------------------- StackTrace ----------------------------- {{{1 -// PCs in stack traces are actually the return addresses, that is, -// addresses of the next instructions after the call. That's why we -// decrement them. -static uptr patch_pc(uptr pc) { +uptr StackTrace::GetPreviousInstructionPc(uptr pc) { #ifdef __arm__ // Cancel Thumb bit. pc = pc & (~1); @@ -71,7 +68,9 @@ void StackTrace::PrintStack(const uptr *addr, uptr size, InternalScopedBuffer<AddressInfo> addr_frames(64); uptr frame_num = 0; for (uptr i = 0; i < size && addr[i]; i++) { - uptr pc = patch_pc(addr[i]); + // PCs in stack traces are actually the return addresses, that is, + // addresses of the next instructions after the call. + uptr pc = GetPreviousInstructionPc(addr[i]); uptr addr_frames_num = 0; // The number of stack frames for current // instruction address. if (symbolize_callback) { |