summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerValueBitMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerValueBitMap.h')
-rw-r--r--llvm/lib/Fuzzer/FuzzerValueBitMap.h5
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;
}
OpenPOWER on IntegriCloud