summaryrefslogtreecommitdiff
path: root/lib/msan/msan.cc
diff options
context:
space:
mode:
authorMarcin Koscielnicki <koriakin@0x04.net>2016-04-27 21:24:24 +0000
committerMarcin Koscielnicki <koriakin@0x04.net>2016-04-27 21:24:24 +0000
commit99528089f365457187a35cdcd3a441d5c83d0825 (patch)
tree3980c862f99273e132ac28dc235ab0c1bc7faf49 /lib/msan/msan.cc
parent9b30f142d2bd6e1e85447e38d3a61ba92405b434 (diff)
[MSan] [PowerPC] Dereference function descriptors when recording stack origins.
Differential Revision: http://reviews.llvm.org/D19543 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan.cc')
-rw-r--r--lib/msan/msan.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/msan/msan.cc b/lib/msan/msan.cc
index 52eda77e6..d2981f0b0 100644
--- a/lib/msan/msan.cc
+++ b/lib/msan/msan.cc
@@ -538,6 +538,13 @@ void __msan_set_alloca_origin4(void *a, uptr size, char *descr, uptr pc) {
u32 idx = atomic_fetch_add(&NumStackOriginDescrs, 1, memory_order_relaxed);
CHECK_LT(idx, kNumStackOriginDescrs);
StackOriginDescr[idx] = descr + 4;
+#if SANITIZER_PPC64V1
+ // On PowerPC64 ELFv1, 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.
+ if (pc)
+ pc = *reinterpret_cast<uptr*>(pc);
+#endif
StackOriginPC[idx] = pc;
id = Origin::CreateStackOrigin(idx).raw_id();
*id_ptr = id;