diff options
author | Kostya Serebryany <kcc@google.com> | 2017-03-14 21:40:53 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2017-03-14 21:40:53 +0000 |
commit | 24d0016bbd0af34b4ca6aaa779496e6dece59dcc (patch) | |
tree | 063e1dcc41400a6f399f60fe0388434c893024eb /llvm/lib/Fuzzer/FuzzerTracePC.h | |
parent | 8a4bae99937c003eb9c7a3be1f16c54cab1c0c80 (diff) | |
download | bcm5719-llvm-24d0016bbd0af34b4ca6aaa779496e6dece59dcc.tar.gz bcm5719-llvm-24d0016bbd0af34b4ca6aaa779496e6dece59dcc.zip |
[libFuzzer] don't clear Counters in TracePC::CollectFeatures since they will be cleared anyway in ResetMaps
llvm-svn: 297783
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerTracePC.h')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerTracePC.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.h b/llvm/lib/Fuzzer/FuzzerTracePC.h index b33d38747a3..05d03e960c9 100644 --- a/llvm/lib/Fuzzer/FuzzerTracePC.h +++ b/llvm/lib/Fuzzer/FuzzerTracePC.h @@ -57,7 +57,7 @@ class TracePC { void SetUseCounters(bool UC) { UseCounters = UC; } void SetUseValueProfile(bool VP) { UseValueProfile = VP; } void SetPrintNewPCs(bool P) { DoPrintNewPCs = P; } - template <class Callback> size_t CollectFeatures(Callback CB); + template <class Callback> size_t CollectFeatures(Callback CB) const; void ResetMaps() { ValueProfileMap.Reset(); @@ -111,7 +111,7 @@ private: }; template <class Callback> -size_t TracePC::CollectFeatures(Callback CB) { +size_t TracePC::CollectFeatures(Callback CB) const { if (!UsingTracePcGuard()) return 0; size_t Res = 0; const size_t Step = 8; @@ -125,7 +125,6 @@ size_t TracePC::CollectFeatures(Callback CB) { for (size_t i = Idx; i < Idx + Step; i++) { uint8_t Counter = (Bundle >> ((i - Idx) * 8)) & 0xff; if (!Counter) continue; - Counters[i] = 0; unsigned Bit = 0; /**/ if (Counter >= 128) Bit = 7; else if (Counter >= 32) Bit = 6; |