diff options
author | Juergen Ributzka <juergen@ributzka.de> | 2017-03-17 01:15:39 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@ributzka.de> | 2017-03-17 01:15:39 +0000 |
commit | 0dc7254c899cea943b53be0b267711685b95a8b6 (patch) | |
tree | e555c13a171a02d458fe856ff3faaf253961913f /lib/sanitizer_common/sanitizer_stacktrace.cc | |
parent | a9c608446e5bf5e35e50e9a77751b773cc28e722 (diff) |
Revert "[PowerPC] Fix sanitizer frame unwind on 32-bit ABIs"
This broke GreenDragon:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/29210/
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_stacktrace.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_stacktrace.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/sanitizer_common/sanitizer_stacktrace.cc b/lib/sanitizer_common/sanitizer_stacktrace.cc index 3453b8bad..2741dde7a 100644 --- a/lib/sanitizer_common/sanitizer_stacktrace.cc +++ b/lib/sanitizer_common/sanitizer_stacktrace.cc @@ -79,22 +79,15 @@ void BufferedStackTrace::FastUnwindStack(uptr pc, uptr bp, uptr stack_top, while (IsValidFrame((uptr)frame, stack_top, bottom) && IsAligned((uptr)frame, sizeof(*frame)) && size < max_depth) { - // PowerPC ABIs specify that the return address is saved on the - // *caller's* stack frame. Thus we must dereference the back chain - // to find the caller frame before extracting it. - uhwptr *caller_frame = (uhwptr*)frame[0]; - if (!IsValidFrame((uptr)caller_frame, stack_top, bottom) || - !IsAligned((uptr)caller_frame, sizeof(uhwptr))) - break; #ifdef __powerpc__ - // For most ABIs the offset where the return address is saved is two - // register sizes. The exception is the SVR4 ABI, which uses an - // offset of only one register size. -#ifdef _CALL_SYSV - uhwptr pc1 = caller_frame[1]; -#else + // PowerPC ABIs specify that the return address is saved at offset + // 16 of the *caller's* stack frame. Thus we must dereference the + // back chain to find the caller frame before extracting it. + uhwptr *caller_frame = (uhwptr*)frame[0]; + if (!IsValidFrame((uptr)caller_frame, stack_top, bottom) || + !IsAligned((uptr)caller_frame, sizeof(uhwptr))) + break; uhwptr pc1 = caller_frame[2]; -#endif #elif defined(__s390__) uhwptr pc1 = frame[14]; #else |