mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-13 18:48:08 +00:00
fix classic threadsafe counters
This commit is contained in:
@ -662,10 +662,11 @@ bool AFLCoverage::runOnModule(Module &M) {
|
|||||||
/* Update bitmap */
|
/* Update bitmap */
|
||||||
|
|
||||||
if (use_threadsafe_counters) { /* Atomic */
|
if (use_threadsafe_counters) { /* Atomic */
|
||||||
|
/*
|
||||||
#if LLVM_VERSION_MAJOR < 9
|
#if LLVM_VERSION_MAJOR < 9
|
||||||
if (neverZero_counters_str !=
|
if (neverZero_counters_str !=
|
||||||
NULL) { // with llvm 9 we make this the default as the bug in llvm
|
NULL) { // with llvm 9 we make this the default as the bug
|
||||||
|
in llvm
|
||||||
// is then fixed
|
// is then fixed
|
||||||
#else
|
#else
|
||||||
if (!skip_nozero) {
|
if (!skip_nozero) {
|
||||||
@ -676,11 +677,15 @@ bool AFLCoverage::runOnModule(Module &M) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
*/
|
||||||
IRB.CreateAtomicRMW(llvm::AtomicRMWInst::BinOp::Add, MapPtrIdx, One,
|
IRB.CreateAtomicRMW(llvm::AtomicRMWInst::BinOp::Add, MapPtrIdx, One,
|
||||||
llvm::AtomicOrdering::Monotonic);
|
llvm::AtomicOrdering::Monotonic);
|
||||||
|
/*
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
LoadInst *Counter = IRB.CreateLoad(MapPtrIdx);
|
LoadInst *Counter = IRB.CreateLoad(MapPtrIdx);
|
||||||
@ -774,6 +779,7 @@ bool AFLCoverage::runOnModule(Module &M) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (use_threadsafe_counters) { /*Atomic NeverZero */
|
if (use_threadsafe_counters) { /*Atomic NeverZero */
|
||||||
// handle the list of registered blocks to instrument
|
// handle the list of registered blocks to instrument
|
||||||
for (auto val : todo) {
|
for (auto val : todo) {
|
||||||
@ -885,6 +891,8 @@ bool AFLCoverage::runOnModule(Module &M) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user