mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-11 17:51:32 +00:00
fixes lots of llvm warnings
This commit is contained in:
parent
9ff9ff2ad2
commit
5f0a9c90c8
@ -241,7 +241,7 @@ endif
|
||||
ifneq "$(LLVM_CONFIG)" ""
|
||||
CLANG_CFL += -I$(shell dirname $(LLVM_CONFIG))/../include
|
||||
endif
|
||||
CLANG_CPPFL = `$(LLVM_CONFIG) --cxxflags` -fno-rtti -fPIC $(CXXFLAGS)
|
||||
CLANG_CPPFL = `$(LLVM_CONFIG) --cxxflags` -fno-rtti -fPIC $(CXXFLAGS) -Wno-deprecated-declarations
|
||||
CLANG_LFL = `$(LLVM_CONFIG) --ldflags` $(LDFLAGS)
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ struct InsTrim : public ModulePass {
|
||||
#ifdef AFL_HAVE_VECTOR_INTRINSICS
|
||||
unsigned int ngram_size = 0;
|
||||
/* Decide previous location vector size (must be a power of two) */
|
||||
VectorType *PrevLocTy;
|
||||
VectorType *PrevLocTy = NULL;
|
||||
|
||||
if (ngram_size_str)
|
||||
if (sscanf(ngram_size_str, "%u", &ngram_size) != 1 || ngram_size < 2 ||
|
||||
@ -194,7 +194,7 @@ struct InsTrim : public ModulePass {
|
||||
new GlobalVariable(M, PointerType::get(Int8Ty, 0), false,
|
||||
GlobalValue::ExternalLinkage, 0, "__afl_area_ptr");
|
||||
GlobalVariable *AFLPrevLoc;
|
||||
GlobalVariable *AFLContext;
|
||||
GlobalVariable *AFLContext = NULL;
|
||||
LoadInst * PrevCtx = NULL; // for CTX sensitive coverage
|
||||
|
||||
if (ctx_str)
|
||||
|
@ -379,7 +379,9 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
||||
|
||||
if (instrument_mode == INSTRUMENT_PCGUARD) {
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 4
|
||||
#if LLVM_VERSION_MAJOR > 4 || \
|
||||
(LLVM_VERSION_MAJOR == 4 && \
|
||||
(LLVM_VERSION_MINOR > 0 || LLVM_VERSION_PATCH >= 1))
|
||||
cc_params[cc_par_cnt++] =
|
||||
"-fsanitize-coverage=trace-pc-guard"; // edge coverage by default
|
||||
#else
|
||||
|
@ -278,7 +278,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (debug) {
|
||||
|
||||
(void)getcwd(thecwd, sizeof(thecwd));
|
||||
if (getcwd(thecwd, sizeof(thecwd)) != 0) strcpy(thecwd, ".");
|
||||
|
||||
SAYF(cMGN "[D] " cRST "cd \"%s\";", thecwd);
|
||||
for (i = 0; i < argc; i++)
|
||||
|
@ -260,7 +260,8 @@ void scanForDangerousFunctions(llvm::Module *M) {
|
||||
|
||||
if (!M) return;
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 4
|
||||
#if LLVM_VERSION_MAJOR > 3 || \
|
||||
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 9)
|
||||
|
||||
for (GlobalIFunc &IF : M->ifuncs()) {
|
||||
|
||||
@ -345,20 +346,14 @@ static std::string getSourceName(llvm::Function *F) {
|
||||
|
||||
DILocation *cDILoc = dyn_cast<DILocation>(Loc.getAsMDNode());
|
||||
|
||||
unsigned int instLine = cDILoc->getLine();
|
||||
StringRef instFilename = cDILoc->getFilename();
|
||||
StringRef instFilename = cDILoc->getFilename();
|
||||
|
||||
if (instFilename.str().empty()) {
|
||||
|
||||
/* If the original location is empty, try using the inlined location
|
||||
*/
|
||||
DILocation *oDILoc = cDILoc->getInlinedAt();
|
||||
if (oDILoc) {
|
||||
|
||||
instFilename = oDILoc->getFilename();
|
||||
instLine = oDILoc->getLine();
|
||||
|
||||
}
|
||||
if (oDILoc) { instFilename = oDILoc->getFilename(); }
|
||||
|
||||
}
|
||||
|
||||
@ -371,10 +366,8 @@ static std::string getSourceName(llvm::Function *F) {
|
||||
|
||||
DILocation cDILoc(Loc.getAsMDNode(F->getContext()));
|
||||
|
||||
unsigned int instLine = cDILoc.getLineNumber();
|
||||
StringRef instFilename = cDILoc.getFilename();
|
||||
StringRef instFilename = cDILoc.getFilename();
|
||||
|
||||
(void)instLine;
|
||||
/* Continue only if we know where we actually are */
|
||||
return instFilename.str();
|
||||
|
||||
|
@ -596,7 +596,7 @@ bool AFLLTOPass::runOnModule(Module &M) {
|
||||
do {
|
||||
|
||||
--i;
|
||||
BasicBlock * newBB;
|
||||
BasicBlock * newBB = NULL;
|
||||
BasicBlock * origBB = &(*InsBlocks[i]);
|
||||
std::vector<BasicBlock *> Successors;
|
||||
Instruction * TI = origBB->getTerminator();
|
||||
|
@ -194,7 +194,7 @@ bool AFLCoverage::runOnModule(Module &M) {
|
||||
|
||||
#ifdef AFL_HAVE_VECTOR_INTRINSICS
|
||||
/* Decide previous location vector size (must be a power of two) */
|
||||
VectorType *PrevLocTy;
|
||||
VectorType *PrevLocTy = NULL;
|
||||
|
||||
if (ngram_size_str)
|
||||
if (sscanf(ngram_size_str, "%u", &ngram_size) != 1 || ngram_size < 2 ||
|
||||
@ -236,7 +236,7 @@ bool AFLCoverage::runOnModule(Module &M) {
|
||||
new GlobalVariable(M, PointerType::get(Int8Ty, 0), false,
|
||||
GlobalValue::ExternalLinkage, 0, "__afl_area_ptr");
|
||||
GlobalVariable *AFLPrevLoc;
|
||||
GlobalVariable *AFLContext;
|
||||
GlobalVariable *AFLContext = NULL;
|
||||
|
||||
if (ctx_str)
|
||||
#ifdef __ANDROID__
|
||||
@ -292,7 +292,7 @@ bool AFLCoverage::runOnModule(Module &M) {
|
||||
ConstantInt *Zero = ConstantInt::get(Int8Ty, 0);
|
||||
ConstantInt *One = ConstantInt::get(Int8Ty, 1);
|
||||
|
||||
LoadInst *PrevCtx; // CTX sensitive coverage
|
||||
LoadInst *PrevCtx = NULL; // CTX sensitive coverage
|
||||
|
||||
/* Instrument all the things! */
|
||||
|
||||
|
@ -137,7 +137,6 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
|
||||
bool isStrcasecmp = processStrcasecmp;
|
||||
bool isStrncasecmp = processStrncasecmp;
|
||||
bool isIntMemcpy = true;
|
||||
bool indirect = false;
|
||||
|
||||
Function *Callee = callInst->getCalledFunction();
|
||||
if (!Callee) continue;
|
||||
@ -264,8 +263,6 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
|
||||
|
||||
}
|
||||
|
||||
if ((HasStr1 || HasStr2)) indirect = true;
|
||||
|
||||
}
|
||||
|
||||
if (isIntMemcpy) continue;
|
||||
@ -278,7 +275,6 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
|
||||
|
||||
Str1 = StringRef(*val);
|
||||
HasStr1 = true;
|
||||
indirect = true;
|
||||
// fprintf(stderr, "loaded1 %s\n", Str1.str().c_str());
|
||||
|
||||
} else {
|
||||
@ -288,7 +284,6 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
|
||||
|
||||
Str2 = StringRef(*val);
|
||||
HasStr2 = true;
|
||||
indirect = true;
|
||||
// fprintf(stderr, "loaded2 %s\n", Str2.str().c_str());
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user