[PATCH] D11832: [Patch] [Analyzer] false positive: Potential leak connected with memcpy (PR 22954)

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 27 15:07:31 PDT 2015


dcoughlin added a comment.

Other than one teeny nit, looks good to me.


================
Comment at: lib/StaticAnalyzer/Checkers/CStringChecker.cpp:863
@@ +862,3 @@
+
+  const ElementRegion *ER = dyn_cast<ElementRegion>(R);
+  // Cast is safe as BufVal's region is a FieldRegion.
----------------
You can use cast<ElementRegion>(R) here, which will assert that R is an ElementRegion, and remove the assert below.


http://reviews.llvm.org/D11832





More information about the cfe-commits mailing list