summaryrefslogtreecommitdiff
path: root/lib/asan/asan_report.cc
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-05-22 14:21:34 +0000
committerKostya Serebryany <kcc@google.com>2013-05-22 14:21:34 +0000
commitd570bb4c7d82767d26ada0f923f84b10d8ec0fc6 (patch)
treec98bf9bfe03a2fa8988875a10e6c916049377602 /lib/asan/asan_report.cc
parent9f58c5c60a56d9c39d36b5313dc87ad4bb713163 (diff)
downloadcompiler-rt-d570bb4c7d82767d26ada0f923f84b10d8ec0fc6.tar.gz
compiler-rt-d570bb4c7d82767d26ada0f923f84b10d8ec0fc6.tar.bz2
compiler-rt-d570bb4c7d82767d26ada0f923f84b10d8ec0fc6.tar.xz
[asan] fix the reported PCs for powerpc64
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_report.cc')
-rw-r--r--lib/asan/asan_report.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/asan/asan_report.cc b/lib/asan/asan_report.cc
index 38050786..aeeebf45 100644
--- a/lib/asan/asan_report.cc
+++ b/lib/asan/asan_report.cc
@@ -273,6 +273,14 @@ bool DescribeAddressIfStack(uptr addr, uptr access_size) {
uptr frame_pc = 0;
char tname[128];
const char *frame_descr = t->GetFrameNameByAddr(addr, &offset, &frame_pc);
+
+#ifdef __powerpc64__
+ // On PowerPC64, the address of a function actually points to a
+ // three-doubleword data structure with the first field containing
+ // the address of the function's code.
+ frame_pc = *reinterpret_cast<uptr *>(frame_pc);
+#endif
+
// This string is created by the compiler and has the following form:
// "n alloc_1 alloc_2 ... alloc_n"
// where alloc_i looks like "offset size len ObjectName ".