[PATCH] D42645: New simple Checker for mmap calls

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 12:37:28 PST 2018


NoQ added a comment.

All right, so the code looks good now, but in order to commit this, we also need tests. We've got those automatic tests of ours in `test/Analysis/` that feed small code snippets into the analyzer and verify that it does (or doesn't) emit warnings in certain cases, so you'd need to prove that your checker works (as intended, ideally) by writing some of those (http://clang-analyzer.llvm.org/checker_dev_manual.html#testing).



================
Comment at: lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp:45-46
+                                         CheckerContext &C) const {
+  if (Call.isCalled(MmapFn)) {
+    if (Call.getNumArgs() < 3)
+      return;
----------------
You can include the required number of arguments in CallDescription.


Repository:
  rC Clang

https://reviews.llvm.org/D42645





More information about the cfe-commits mailing list