aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--executor/executor.cc2
-rw-r--r--executor/executor_test.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index cf80d7491..616e86752 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -340,6 +340,8 @@ struct cover_t {
uint32 mmap_alloc_size;
char* data;
char* data_end;
+ // Currently collecting comparisons.
+ bool collect_comps;
// Note: On everything but darwin the first value in data is the count of
// recorded PCs, followed by the PCs. We therefore set data_offset to the
// size of one PC.
diff --git a/executor/executor_test.h b/executor/executor_test.h
index 870dcb397..a5eda15d2 100644
--- a/executor/executor_test.h
+++ b/executor/executor_test.h
@@ -43,7 +43,7 @@ extern "C" notrace void __sanitizer_cov_trace_pc(void)
unsigned long ip = (unsigned long)__builtin_return_address(0);
// Convert to what is_kernel_pc will accept as valid coverage;
ip = kernel_text_start | (ip & kernel_text_mask);
- if (current_thread == nullptr || current_thread->cov.data == nullptr)
+ if (current_thread == nullptr || current_thread->cov.data == nullptr || current_thread->cov.collect_comps)
return;
unsigned long* start = (unsigned long*)current_thread->cov.data;
unsigned long* end = (unsigned long*)current_thread->cov.data_end;
@@ -61,6 +61,7 @@ static void cover_open(cover_t* cov, bool extra)
static void cover_enable(cover_t* cov, bool collect_comps, bool extra)
{
+ cov->collect_comps = collect_comps;
}
static void cover_reset(cover_t* cov)