[llvm] r244165 - [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.
Kostya Serebryany
kcc at google.com
Wed Aug 5 16:02:57 PDT 2015
Author: kcc
Date: Wed Aug 5 18:02:57 2015
New Revision: 244165
URL: http://llvm.org/viewvc/llvm-project?rev=244165&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp
Modified: llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp?rev=244165&r1=244164&r2=244165&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp Wed Aug 5 18:02:57 2015
@@ -394,6 +394,9 @@ static TraceState *TS;
void Fuzzer::StartTraceRecording() {
if (!TS) return;
+ if (ReallyHaveDFSan())
+ for (size_t i = 0; i < static_cast<size_t>(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);
}
}
More information about the llvm-commits
mailing list