Bug 1529650 - For SprintfLiteral checker also disallow it in third party paths. r=froydnj
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 27 Feb 2019 15:15:24 +0000
changeset 520514 8f243b54b8035e15d44b1eb8c266234e05fa541e
parent 520513 980042eb94d3a705b7d62eff885805125bcd5303
child 520515 529da09b7f7e2165081e4a885e056bb2f974c1df
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1529650
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1529650 - For SprintfLiteral checker also disallow it in third party paths. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D21240
build/clang-plugin/CustomMatchers.h
--- a/build/clang-plugin/CustomMatchers.h
+++ b/build/clang-plugin/CustomMatchers.h
@@ -241,18 +241,20 @@ AST_MATCHER(CallExpr, isSnprintfLikeFunc
     return false;
   }
 
   StringRef Name = getNameChecked(Func);
   if (Name != Snprintf && Name != Vsnprintf) {
     return false;
   }
 
-  return !isIgnoredPathForSprintfLiteral(
-      &Node, Finder->getASTContext().getSourceManager());
+  return !inThirdPartyPath(Node.getBeginLoc(),
+                           Finder->getASTContext().getSourceManager()) &&
+         !isIgnoredPathForSprintfLiteral(
+             &Node, Finder->getASTContext().getSourceManager());
 }
 
 AST_MATCHER(CXXRecordDecl, isLambdaDecl) { return Node.isLambda(); }
 
 AST_MATCHER(QualType, isRefPtr) { return typeIsRefPtr(Node); }
 
 AST_MATCHER(QualType, isSmartPtrToRefCounted) {
   auto *D = getNonTemplateSpecializedCXXRecordDecl(Node);