summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-11-11 22:44:25 +0000
committerKostya Serebryany <kcc@google.com>2015-11-11 22:44:25 +0000
commit673283cc7c11de672e1b72d9c38a729da81035ae (patch)
tree56a42e75f5f8582d86dcdb0655ff55cfb38802a7 /compiler-rt/lib
parent68150269914cb43e10a636cc9c84eb6a36cc8262 (diff)
downloadbcm5719-llvm-673283cc7c11de672e1b72d9c38a729da81035ae.tar.gz
bcm5719-llvm-673283cc7c11de672e1b72d9c38a729da81035ae.zip
[sanitizer coverage] reset global counters in __sanitizer_reset_coverage
llvm-svn: 252815
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
index f052f2672c9..25133172098 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
@@ -55,6 +55,11 @@ static atomic_uint32_t dump_once_guard; // Ensure that CovDump runs only once.
static atomic_uintptr_t coverage_counter;
static atomic_uintptr_t caller_callee_counter;
+static void ResetGlobalCounters() {
+ return atomic_store(&coverage_counter, 0, memory_order_relaxed);
+ return atomic_store(&caller_callee_counter, 0, memory_order_relaxed);
+}
+
// pc_array is the array containing the covered PCs.
// To make the pc_array thread- and async-signal-safe it has to be large enough.
// 128M counters "ought to be enough for anybody" (4M on 32-bit).
@@ -924,6 +929,7 @@ void __sanitizer_cov_trace_basic_block(s32 *id) {
}
SANITIZER_INTERFACE_ATTRIBUTE
void __sanitizer_reset_coverage() {
+ ResetGlobalCounters();
coverage_data.ReinitializeGuards();
internal_bzero_aligned16(
coverage_data.data(),
OpenPOWER on IntegriCloud