[PATCH] D19543: [MSan] [PowerPC] Dereference function descriptors when recording stack origins.
Marcin KoĆcielnicki via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 27 14:30:18 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267795: [MSan] [PowerPC] Dereference function descriptors when recording stack origins. (authored by koriakin).
Changed prior to commit:
http://reviews.llvm.org/D19543?vs=55310&id=55320#toc
Repository:
rL LLVM
http://reviews.llvm.org/D19543
Files:
compiler-rt/trunk/lib/msan/msan.cc
Index: compiler-rt/trunk/lib/msan/msan.cc
===================================================================
--- compiler-rt/trunk/lib/msan/msan.cc
+++ compiler-rt/trunk/lib/msan/msan.cc
@@ -538,6 +538,13 @@
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19543.55320.patch
Type: text/x-patch
Size: 750 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160427/89e3e2fd/attachment.bin>
More information about the llvm-commits
mailing list