Merge pull request #97 from devnexen/llvm_mode_build_silent_warn

Fix some silent warnings and put some var to some usage...
This commit is contained in:
van Hauser
2019-10-31 12:53:47 +01:00
committed by GitHub
3 changed files with 15 additions and 6 deletions

View File

@ -158,6 +158,7 @@ struct InsTrim : public ModulePass {
bool instrumentBlock = false; bool instrumentBlock = false;
DebugLoc Loc; DebugLoc Loc;
StringRef instFilename; StringRef instFilename;
unsigned int instLine = 0;
for (auto &BB : F) { for (auto &BB : F) {
@ -171,7 +172,7 @@ struct InsTrim : public ModulePass {
DILocation *cDILoc = dyn_cast<DILocation>(Loc.getAsMDNode()); DILocation *cDILoc = dyn_cast<DILocation>(Loc.getAsMDNode());
unsigned int instLine = cDILoc->getLine(); instLine = cDILoc->getLine();
instFilename = cDILoc->getFilename(); instFilename = cDILoc->getFilename();
if (instFilename.str().empty()) { if (instFilename.str().empty()) {
@ -217,11 +218,13 @@ struct InsTrim : public ModulePass {
* not whitelisted, so we skip instrumentation. */ * not whitelisted, so we skip instrumentation. */
if (!instrumentBlock) { if (!instrumentBlock) {
if (!instFilename.str().empty()) if (!be_quiet) {
SAYF(cYEL "[!] " cBRI "Not in whitelist, skipping %s ...\n", if (!instFilename.str().empty())
instFilename.str().c_str()); SAYF(cYEL "[!] " cBRI "Not in whitelist, skipping %s line %u...\n",
else instFilename.str().c_str(), instLine);
SAYF(cYEL "[!] " cBRI "No filename information found, skipping it"); else
SAYF(cYEL "[!] " cBRI "No filename information found, skipping it");
}
continue; continue;
} }

View File

@ -190,6 +190,8 @@ bool AFLCoverage::runOnModule(Module &M) {
} }
(void)instLine;
/* Continue only if we know where we actually are */ /* Continue only if we know where we actually are */
if (!instFilename.str().empty()) { if (!instFilename.str().empty()) {

View File

@ -234,6 +234,10 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
ConstantInt *ilen = dyn_cast<ConstantInt>(op2); ConstantInt *ilen = dyn_cast<ConstantInt>(op2);
sizedLen = ilen->getZExtValue(); sizedLen = ilen->getZExtValue();
} else {
sizedLen = 0;
} }
if (HasStr1) { if (HasStr1) {