diff --git a/compiler-rt/lib/msan/msan.cpp b/compiler-rt/lib/msan/msan.cpp --- a/compiler-rt/lib/msan/msan.cpp +++ b/compiler-rt/lib/msan/msan.cpp @@ -607,16 +607,14 @@ } void __msan_set_alloca_origin(void *a, uptr size, char *descr) { - SetAllocaOrigin(a, size, descr, - StackTrace::GetPreviousInstructionPc(GET_CALLER_PC())); + SetAllocaOrigin(a, size, descr, GET_CALLER_PC()); } void __msan_set_alloca_origin4(void *a, uptr size, char *descr, uptr pc) { // Intentionally ignore pc and use return address. This function is here for // compatibility, in case program is linked with library instrumented by // older clang. - SetAllocaOrigin(a, size, descr, - StackTrace::GetPreviousInstructionPc(GET_CALLER_PC())); + SetAllocaOrigin(a, size, descr, GET_CALLER_PC()); } u32 __msan_chain_origin(u32 id) { diff --git a/compiler-rt/lib/msan/msan_report.cpp b/compiler-rt/lib/msan/msan_report.cpp --- a/compiler-rt/lib/msan/msan_report.cpp +++ b/compiler-rt/lib/msan/msan_report.cpp @@ -42,12 +42,8 @@ " in the stack frame%s\n", d.Origin(), d.Name(), so, d.Origin(), d.Default()); - if (pc) { - // For some reason function address in LLVM IR is 1 less then the address - // of the first instruction. - pc = StackTrace::GetNextInstructionPc(pc); + if (pc) StackTrace(&pc, 1).Print(); - } } static void DescribeOrigin(u32 id) {