diff options
author | bloodstalker <thabogre@gmail.com> | 2018-11-26 14:08:43 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-11-26 14:08:43 +0000 |
commit | dc22658993ae658bca4ed8bae0e4fcb219059de4 (patch) | |
tree | 8641c62b5caf38546e2b984f9e372c165adfb326 /m0 | |
parent | lgtm (diff) | |
download | mutator-dc22658993ae658bca4ed8bae0e4fcb219059de4.tar.gz mutator-dc22658993ae658bca4ed8bae0e4fcb219059de4.zip |
introducing cgrep, a new addition to the mutator family. updated the readme for bruiser. some minor changes to the wasm setter test script. things look more or less fine. i still need to add a repackage function to faultreiber.
Diffstat (limited to 'm0')
-rw-r--r-- | m0/mutator-lvl0.cpp | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/m0/mutator-lvl0.cpp b/m0/mutator-lvl0.cpp index d8dfc46..f6663dd 100644 --- a/m0/mutator-lvl0.cpp +++ b/m0/mutator-lvl0.cpp @@ -5436,41 +5436,19 @@ class SFCPPARR02SUB : public MatchFinder::MatchCallback if (MR.Nodes.getNodeAs<clang::DeclRefExpr>("sfcpp02sub") != nullptr) { const DeclRefExpr* DRE = MR.Nodes.getNodeAs<clang::DeclRefExpr>("sfcpp02sub"); - SourceManager *const SM = MR.SourceManager; - SourceLocation SL = DRE->DEVI_GETLOCSTART(); CheckSLValidity(SL); - //SL = Devi::SourceLocationHasMacro(SL, Rewrite, "start"); SL = SM->getSpellingLoc(SL); - - if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, MR, SL)) - { - return void(); - } - - if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) - { - return void(); - } - + if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, MR, SL)) {return void();} + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) {return void();} const NamedDecl* ND = DRE->getFoundDecl(); - SourceLocation OriginSL = ND->DEVI_GETLOCSTART(); CheckSLValidity(OriginSL); - //OriginSL = Devi::SourceLocationHasMacro(OriginSL, Rewrite, "start"); OriginSL = SM->getSpellingLoc(OriginSL); - StringRef OriginFileName [[maybe_unused]] = SM->getFilename(OriginSL); -#if 0 - std::cout << "GarbageOut" << ":" << "Origin:" << DRE->getFoundDecl()->getName().str() << "\n"; - std::cout << "GarbageOut" << ":" << "Origin:" << ExtOriginFileName.str() << ":" << "Proto:" << OriginFileName.str() << "\n"; - std::cout << "GarbageOut" << ":" << "Origin:" << ExtOriginSL.printToString(*SM) << ":" << "Proto:" << OriginSL.printToString(*SM) << "\n"; -#endif - - if (OriginSL == ExtOriginSL && OriginFileName == ExtOriginFileName) - { + if (OriginSL == ExtOriginSL && OriginFileName == ExtOriginFileName) { std::cout << "SaferCPP01" << ":" << "Native Array used - pointer points to an array:" << SL.printToString(*MR.SourceManager) << ":" << DRE->getFoundDecl()->getName().str() << "\n"; } @@ -5508,29 +5486,17 @@ class SFCPPARR02 : public MatchFinder::MatchCallback if (MR.Nodes.getNodeAs<clang::DeclRefExpr>("sfcpparrdeep") != nullptr) { const DeclRefExpr* DRE = MR.Nodes.getNodeAs<clang::DeclRefExpr>("sfcpparrdeep"); - ASTContext *const ASTC = MR.Context; - SourceManager *const SM = MR.SourceManager; - SourceLocation SL = DRE->DEVI_GETLOCSTART(); CheckSLValidity(SL); SL = SM->getSpellingLoc(SL); - const NamedDecl* ND = DRE->getFoundDecl(); - StringRef NDName = ND->getName(); - SubHandler.setOriginSourceLocation(SM->getSpellingLoc(ND->DEVI_GETLOCSTART())); SubHandler.setOriginFileName(SM->getFilename(SM->getSpellingLoc(ND->DEVI_GETLOCSTART()))); - Matcher.addMatcher(declRefExpr(to(varDecl(hasName(NDName.str())))).bind("sfcpp02sub"), &SubHandler); - Matcher.matchAST(*ASTC); - -#if 0 - std::cout << "GarbageOutOrigin" << ":" << "GarbageOutOrigin:" << SL.printToString(*MR.SourceManager) << ":" << NDName.str() << "\n"; -#endif } } |