diff options
| author | hexcoder- <heiko@hexco.de> | 2021-04-17 22:32:33 +0200 |
|---|---|---|
| committer | hexcoder- <heiko@hexco.de> | 2021-04-17 22:32:33 +0200 |
| commit | ec49c7fbf5b5dd2259ebfd4a92f6aad5b333c328 (patch) | |
| tree | 5664d9d273bdb02e8d6865cf8b50600df4373365 /instrumentation/SanitizerCoverageLTO.so.cc | |
| parent | 00e54565ef109a6c697db77b19d1618e37092125 (diff) | |
| download | afl++-ec49c7fbf5b5dd2259ebfd4a92f6aad5b333c328.tar.gz | |
Change other LLVM modes to atomic increments
Diffstat (limited to 'instrumentation/SanitizerCoverageLTO.so.cc')
| -rw-r--r-- | instrumentation/SanitizerCoverageLTO.so.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/instrumentation/SanitizerCoverageLTO.so.cc b/instrumentation/SanitizerCoverageLTO.so.cc index 6dd390e6..cd6b1939 100644 --- a/instrumentation/SanitizerCoverageLTO.so.cc +++ b/instrumentation/SanitizerCoverageLTO.so.cc @@ -1496,7 +1496,11 @@ void ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB, } /* Update bitmap */ +#if 1 /* Atomic */ + IRB.CreateAtomicRMW(llvm::AtomicRMWInst::BinOp::Add, MapPtrIdx, One, + llvm::AtomicOrdering::Monotonic); +#else LoadInst *Counter = IRB.CreateLoad(MapPtrIdx); Counter->setMetadata(Mo->getMDKindID("nosanitize"), MDNode::get(*Ct, None)); @@ -1512,7 +1516,7 @@ void ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB, IRB.CreateStore(Incr, MapPtrIdx) ->setMetadata(Mo->getMDKindID("nosanitize"), MDNode::get(*Ct, None)); - +#endif // done :) inst++; |
