diff options
author | Kostya Serebryany <kcc@google.com> | 2017-01-25 01:14:24 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2017-01-25 01:14:24 +0000 |
commit | a39f5f84558588b1422ec7fde1434f7b91caa16a (patch) | |
tree | dae52d539fa30cccea0e18adf1e89ce1e4883268 /lib | |
parent | a94309f16172e365718baa5f7d24a2f46a9f951b (diff) |
[asan] fix __sanitizer_cov_with_check to get the correct caller PC. Before this fix the code relied on the fact that the other function (__sanitizer_cov) is inlined. This was true with clang builds on x86, but not true with gcc builds on x86 and on PPC. This caused bot redness after r292862
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sanitizer_common/sanitizer_coverage_libcdep.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_coverage_libcdep.cc b/lib/sanitizer_common/sanitizer_coverage_libcdep.cc index 497bdcb88..73cb2f200 100644 --- a/lib/sanitizer_common/sanitizer_coverage_libcdep.cc +++ b/lib/sanitizer_common/sanitizer_coverage_libcdep.cc @@ -939,7 +939,8 @@ SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_with_check(u32 *guard) { atomic_uint32_t *atomic_guard = reinterpret_cast<atomic_uint32_t*>(guard); if (static_cast<s32>( __sanitizer::atomic_load(atomic_guard, memory_order_relaxed)) < 0) - __sanitizer_cov(guard); + coverage_data.Add(StackTrace::GetPreviousInstructionPc(GET_CALLER_PC()), + guard); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_indir_call16(uptr callee, uptr callee_cache16[]) { |