[compiler-rt] r267795 - [MSan] [PowerPC] Dereference function descriptors when recording stack origins.

Marcin Koscielnicki via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 14:24:25 PDT 2016


Author: koriakin
Date: Wed Apr 27 16:24:24 2016
New Revision: 267795

URL: http://llvm.org/viewvc/llvm-project?rev=267795&view=rev
Log:
[MSan] [PowerPC] Dereference function descriptors when recording stack origins.

Differential Revision: http://reviews.llvm.org/D19543

Modified:
    compiler-rt/trunk/lib/msan/msan.cc

Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=267795&r1=267794&r2=267795&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Wed Apr 27 16:24:24 2016
@@ -538,6 +538,13 @@ void __msan_set_alloca_origin4(void *a,
     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;




More information about the llvm-commits mailing list