[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:14:28 PDT 2016


koriakin updated the summary for this revision.
koriakin updated this revision to Diff 55310.
koriakin added a comment.

Whoops, of course it is.  Fixed.


Repository:
  rL LLVM

http://reviews.llvm.org/D19543

Files:
  lib/msan/msan.cc

Index: lib/msan/msan.cc
===================================================================
--- lib/msan/msan.cc
+++ 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.55310.patch
Type: text/x-patch
Size: 696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160427/d65d2748/attachment.bin>


More information about the llvm-commits mailing list