aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Fuzzer/FuzzerLoop.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-05-26 21:32:30 +0000
committerKostya Serebryany <kcc@google.com>2016-05-26 21:32:30 +0000
commitf26017baf9d941882e24680518156024ce9c8cae (patch)
treeae83a3da0f9f7b2a8669e2dd50ffa2be999bc984 /llvm/lib/Fuzzer/FuzzerLoop.cpp
parentd121c0872ffee04c436b1af0bdfc7a3a6ff42a51 (diff)
downloadllvm-f26017baf9d941882e24680518156024ce9c8cae.zip
llvm-f26017baf9d941882e24680518156024ce9c8cae.tar.gz
llvm-f26017baf9d941882e24680518156024ce9c8cae.tar.bz2
[libFuzzer] refactor: hide CurrentUnitData inside an interface function. NFC
llvm-svn: 270922
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerLoop.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp
index d924e5d..e38a29a 100644
--- a/llvm/lib/Fuzzer/FuzzerLoop.cpp
+++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp
@@ -61,6 +61,8 @@ namespace fuzzer {
static const size_t kMaxUnitSizeToPrint = 256;
static const size_t TruncateMaxRuns = 1000;
+thread_local bool Fuzzer::IsMyThread;
+
static void MissingWeakApiFunction(const char *FnName) {
Printf("ERROR: %s is not defined. Exiting.\n"
"Did you use -fsanitize-coverage=... to build your code?\n",
@@ -154,6 +156,7 @@ Fuzzer::Fuzzer(UserCallback CB, MutationDispatcher &MD, FuzzingOptions Options)
assert(!F);
F = this;
ResetCoverage();
+ IsMyThread = true;
}
void Fuzzer::SetDeathCallback() {