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

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

llvm-svn: 267795
This commit is contained in:
Marcin Koscielnicki 2016-04-27 21:24:24 +00:00
parent 66f0deacb5
commit 0bec2fef8e

View File

@ -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<uptr*>(pc);
#endif
StackOriginPC[idx] = pc;
id = Origin::CreateStackOrigin(idx).raw_id();
*id_ptr = id;