aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-02-08 09:12:32 +0000
committerbloodstalker <thabogre@gmail.com>2017-02-08 09:12:32 +0000
commit94a73d8785ae34f780c1fe03fd4c338ae2a0eaa4 (patch)
treed28da8c249f991ce23c048ff36522cd41ff686ac
parentuodated 2/8/17 (diff)
downloadmutator-94a73d8785ae34f780c1fe03fd4c338ae2a0eaa4.tar.gz
mutator-94a73d8785ae34f780c1fe03fd4c338ae2a0eaa4.zip
added 19.8
-rw-r--r--mutator-lvl0.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/mutator-lvl0.cpp b/mutator-lvl0.cpp
index bd06212..46ed8e7 100644
--- a/mutator-lvl0.cpp
+++ b/mutator-lvl0.cpp
@@ -48,6 +48,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Lex/Lexer.h"
+#include "clang/Lex/MacroArgs.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PPCallbacks.h"
#include "clang/Tooling/CommonOptionsParser.h"
@@ -6162,7 +6163,6 @@ public:
MacroInfo* MI = MD.getMacroInfo();
- /*underdev2*/
/*start of 19.4*/
ArrayRef<Token> TokenArrayRef = MI->tokens();
@@ -6333,6 +6333,32 @@ public:
}
/*end of 19.4*/
+#if 1
+ if (Args != nullptr)
+ {
+ /*@DEVI-Macro args are passed twice. first they are expanded and then the whole macro,
+ including the args is checked again for expansion, so args are passed twice.*/
+ if (MI->getNumArgs() != Args->getNumArguments() - MI->getNumArgs())
+ {
+ if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, SM, MDSL))
+ {
+ /*intentionally left blank*/
+ }
+ else
+ {
+ if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, MDSL))
+ {
+ std::cout << "19.8:" << "Funciton-like macro invoked with wrong number of arguments:";
+ std::cout << Range.getBegin().printToString(SM) << ":" << Args->getNumArguments() << " " << MI->getNumArgs() << ":" << std::endl;
+
+ XMLDocOut.XMLAddNode(SM, SL, "19.8", "Funciton-like macro invoked with wrong number of arguments:");
+ JSONDocOUT.JSONAddElement(SM, SL, "19.8", "Funciton-like macro invoked with wrong number of arguments:");
+ }
+ }
+ }
+ }
+#endif
+
if (MacroNameString == "offsetof")
{
if (Devi::IsTheMatchInSysHeader(CheckSystemHeader, SM, MDSL))
@@ -7354,6 +7380,11 @@ public:
JSONDocOUT.JSONAddElement(SpellingLine, SpellingColumn, FileName, "14.2", "Expression result is unused:");
}
+ if (Info.getID() == 0U)
+ {
+
+ }
+
}
private: