From 99528089f365457187a35cdcd3a441d5c83d0825 Mon Sep 17 00:00:00 2001 From: Marcin Koscielnicki Date: Wed, 27 Apr 2016 21:24:24 +0000 Subject: [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 --- lib/msan/msan.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/msan/msan.cc') 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(pc); +#endif StackOriginPC[idx] = pc; id = Origin::CreateStackOrigin(idx).raw_id(); *id_ptr = id; -- cgit v1.2.3