From: Kostya Serebryany Date: Wed, 5 Aug 2015 23:02:57 +0000 (+0000) Subject: [libFuzzer] in dfsan mode, set labels every time we start recording traces as opposed... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5707219e9494f14a01ad0ddf0e55a91af1723f7a;p=oota-llvm.git [libFuzzer] in dfsan mode, set labels every time we start recording traces as opposed to doing it at process startup. This ensures that the labels are fresh. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244165 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Fuzzer/FuzzerTraceState.cpp b/lib/Fuzzer/FuzzerTraceState.cpp index 13635a70d76..c6f7c9e5a95 100644 --- a/lib/Fuzzer/FuzzerTraceState.cpp +++ b/lib/Fuzzer/FuzzerTraceState.cpp @@ -394,6 +394,9 @@ static TraceState *TS; void Fuzzer::StartTraceRecording() { if (!TS) return; + if (ReallyHaveDFSan()) + for (size_t i = 0; i < static_cast(Options.MaxLen); i++) + dfsan_set_label(i + 1, &CurrentUnit[i], 1); TS->StartTraceRecording(); } @@ -417,7 +420,6 @@ void Fuzzer::InitializeTraceState() { dfsan_label L = dfsan_create_label("input", (void*)(i + 1)); // We assume that no one else has called dfsan_create_label before. assert(L == i + 1); - dfsan_set_label(L, &CurrentUnit[i], 1); } }