[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.

llvm-svn: 244165
This commit is contained in:
Kostya Serebryany 2015-08-05 23:02:57 +00:00
parent aa365b2fcd
commit 4cc10d432a
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}
}