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 | |
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
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerTracePC.h | 5 | ||||
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerValueBitMap.h | 2 |
2 files changed, 3 insertions, 4 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; diff --git a/llvm/lib/Fuzzer/FuzzerValueBitMap.h b/llvm/lib/Fuzzer/FuzzerValueBitMap.h index 600337ae407..8f7ff74300f 100644 --- a/llvm/lib/Fuzzer/FuzzerValueBitMap.h +++ b/llvm/lib/Fuzzer/FuzzerValueBitMap.h @@ -76,7 +76,7 @@ struct ValueBitMap { template <class Callback> ATTRIBUTE_NO_SANITIZE_ALL - void ForEach(Callback CB) { + void ForEach(Callback CB) const { for (size_t i = 0; i < kMapSizeInWords; i++) if (uintptr_t M = Map[i]) for (size_t j = 0; j < sizeof(M) * 8; j++) |