[PATCH] D49656: [analyzer] Add support for more pointer invalidating functions in InnerPointerChecker

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 25 09:17:32 PDT 2018


xazax.hun added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp:181
 
-  auto *TypeDecl = ObjRegion->getValueType()->getAsCXXRecordDecl();
-  if (TypeDecl->getName() != "basic_string")
-    return;
+    for (unsigned I = 0, E = FD->getNumParams(); I != E; ++I) {
+      QualType ParamTy = FD->getParamDecl(I)->getType();
----------------
rnkovacs wrote:
> xazax.hun wrote:
> > Nit: maybe using `FunctionDecl::parameters` and range based for loop is sligtly cleaner.
> Given that I am manipulating indices below, I feel that actually the plain for loop is a bit simpler here, what do you think?
Indeed, I am fine with the old style loop too. 


https://reviews.llvm.org/D49656





More information about the cfe-commits mailing list