From 94504e9255ec833ed55509a2601deb4b3424fd79 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Wed, 4 Jan 2017 00:11:06 +0330 Subject: fixed all ppcallbacks for macro expands. they now work correctly and actually use the sourcelocation of the macro definition not the expansion for MainOnly and SysHeader --- mutator-lvl0.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mutator-lvl0.cpp b/mutator-lvl0.cpp index 2be95af..b88eff3 100644 --- a/mutator-lvl0.cpp +++ b/mutator-lvl0.cpp @@ -5271,15 +5271,15 @@ public: } /*end of 19.4*/ - if (MacroNameString == "offsetof" && SM.isInSystemHeader(DMD->getLocation())) + if (MacroNameString == "offsetof") { - if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, SM, SL)) + if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, SM, MDSL)) { /*intentionally left blank*/ } else { - if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, MDSL)) { std::cout << "20.6:" << "use of offsetof is illegal:"; std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; @@ -5290,15 +5290,15 @@ public: } } - if (MacroNameString == "setjmp" && SM.isInSystemHeader(DMD->getLocation())) + if (MacroNameString == "setjmp") { - if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, SM, SL)) + if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, SM, MDSL)) { /*intentionally left blank*/ } else { - if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, MDSL)) { std::cout << "20.7:" << "use of setjmp is illegal:"; std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; @@ -5311,14 +5311,14 @@ public: if (!DMD->isDefined()) { - if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, SM, SL)) + if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, SM, MDSL)) { /*intentionally left blank*/ } else { /*@DEVI-by the time we get a callback on our callback, the macri is assigned a default vlaue even if it is undefined in the TU.*/ - if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, MDSL)) { std::cout << "19.11:" << "Use of undefined macro:"; std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; -- cgit v1.2.3