diff options
| author | Kostya Serebryany <kcc@google.com> | 2016-08-16 19:33:51 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2016-08-16 19:33:51 +0000 |
| commit | d46a59fac45931bf3ea5b55246ac64654090901a (patch) | |
| tree | fd121c8437672b9065108b22fc9766a73b8691aa /llvm/lib/Fuzzer/FuzzerValueBitMap.h | |
| parent | 0464ae83e7c70ce502635e0d49004a823cfa80f2 (diff) | |
| download | bcm5719-llvm-d46a59fac45931bf3ea5b55246ac64654090901a.tar.gz bcm5719-llvm-d46a59fac45931bf3ea5b55246ac64654090901a.zip | |
[libFuzzer] new experimental feature: value profiling. Profiles values that affect control flow and treats new values as new coverage.
llvm-svn: 278839
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerValueBitMap.h')
| -rw-r--r-- | llvm/lib/Fuzzer/FuzzerValueBitMap.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerValueBitMap.h b/llvm/lib/Fuzzer/FuzzerValueBitMap.h index 41169d66bc0..493afc574cc 100644 --- a/llvm/lib/Fuzzer/FuzzerValueBitMap.h +++ b/llvm/lib/Fuzzer/FuzzerValueBitMap.h @@ -32,7 +32,7 @@ struct ValueBitMap { Map[WordIdx] |= 1UL << BitIdx; } - // Merges 'Other' into 'this', clear Other, + // Merges 'Other' into 'this', clears 'Other', // returns the number of set bits in 'this'. size_t MergeFrom(ValueBitMap &Other) { uintptr_t Res = 0; @@ -43,7 +43,8 @@ struct ValueBitMap { Map[i] = (M |= O); Other.Map[i] = 0; } - Res += __builtin_popcountl(M); + if (M) + Res += __builtin_popcountl(M); } return Res; } |

