mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-17 20:28:08 +00:00
code cleanup
This commit is contained in:
@ -151,7 +151,8 @@ uint64_t PowerOf2Ceil(unsigned in) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* #if LLVM_VERSION_STRING >= "4.0.1" */
|
/* #if LLVM_VERSION_STRING >= "4.0.1" */
|
||||||
#if LLVM_VERSION_MAJOR >= 4 || (LLVM_VERSION_MAJOR == 4 && LLVM_VERSION_PATCH >= 1)
|
#if LLVM_VERSION_MAJOR >= 4 || \
|
||||||
|
(LLVM_VERSION_MAJOR == 4 && LLVM_VERSION_PATCH >= 1)
|
||||||
#define AFL_HAVE_VECTOR_INTRINSICS 1
|
#define AFL_HAVE_VECTOR_INTRINSICS 1
|
||||||
#endif
|
#endif
|
||||||
bool AFLCoverage::runOnModule(Module &M) {
|
bool AFLCoverage::runOnModule(Module &M) {
|
||||||
@ -217,7 +218,8 @@ bool AFLCoverage::runOnModule(Module &M) {
|
|||||||
if (sscanf(ngram_size_str, "%u", &ngram_size) != 1 || ngram_size < 2 ||
|
if (sscanf(ngram_size_str, "%u", &ngram_size) != 1 || ngram_size < 2 ||
|
||||||
ngram_size > MAX_NGRAM_SIZE)
|
ngram_size > MAX_NGRAM_SIZE)
|
||||||
FATAL(
|
FATAL(
|
||||||
"Bad value of AFL_NGRAM_SIZE (must be between 2 and MAX_NGRAM_SIZE (%u))",
|
"Bad value of AFL_NGRAM_SIZE (must be between 2 and MAX_NGRAM_SIZE "
|
||||||
|
"(%u))",
|
||||||
MAX_NGRAM_SIZE);
|
MAX_NGRAM_SIZE);
|
||||||
|
|
||||||
if (ngram_size == 1) ngram_size = 0;
|
if (ngram_size == 1) ngram_size = 0;
|
||||||
@ -247,17 +249,17 @@ bool AFLCoverage::runOnModule(Module &M) {
|
|||||||
|
|
||||||
#ifdef AFL_HAVE_VECTOR_INTRINSICS
|
#ifdef AFL_HAVE_VECTOR_INTRINSICS
|
||||||
if (ngram_size)
|
if (ngram_size)
|
||||||
# ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
AFLPrevLoc = new GlobalVariable(
|
AFLPrevLoc = new GlobalVariable(
|
||||||
M, PrevLocTy, /* isConstant */ false, GlobalValue::ExternalLinkage,
|
M, PrevLocTy, /* isConstant */ false, GlobalValue::ExternalLinkage,
|
||||||
/* Initializer */ nullptr, "__afl_prev_loc");
|
/* Initializer */ nullptr, "__afl_prev_loc");
|
||||||
# else
|
#else
|
||||||
AFLPrevLoc = new GlobalVariable(
|
AFLPrevLoc = new GlobalVariable(
|
||||||
M, PrevLocTy, /* isConstant */ false, GlobalValue::ExternalLinkage,
|
M, PrevLocTy, /* isConstant */ false, GlobalValue::ExternalLinkage,
|
||||||
/* Initializer */ nullptr, "__afl_prev_loc",
|
/* Initializer */ nullptr, "__afl_prev_loc",
|
||||||
/* InsertBefore */ nullptr, GlobalVariable::GeneralDynamicTLSModel,
|
/* InsertBefore */ nullptr, GlobalVariable::GeneralDynamicTLSModel,
|
||||||
/* AddressSpace */ 0, /* IsExternallyInitialized */ false);
|
/* AddressSpace */ 0, /* IsExternallyInitialized */ false);
|
||||||
# endif
|
#endif
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
@ -594,6 +596,7 @@ bool AFLCoverage::runOnModule(Module &M) {
|
|||||||
Store->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None));
|
Store->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user