[PATCH] D19543: [MSan] [PowerPC] Dereference function descriptors when recording stack origins.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 10:41:55 PDT 2016


koriakin created this revision.
koriakin added reviewers: kcc, eugenis.
koriakin added a subscriber: llvm-commits.
koriakin set the repository for this revision to rL LLVM.
koriakin added a project: Sanitizers.
koriakin added a dependency: D19542: [sanitizers] [NFC] Add defines for the various PowerPC.

Depends on D19542.

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
@@ -537,6 +537,12 @@
     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.
+    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.55038.patch
Type: text/x-patch
Size: 681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160426/4fbfef09/attachment.bin>


More information about the llvm-commits mailing list