[PATCH] D55804: [analyzer] C++17: Fix leak false positives when an object with destructor is returned from the top frame.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 19 12:02:12 PST 2018


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:224
+        bool IsArray = false;
+        V = makeZeroElementRegion(State, V, ReturnTy, IsArray);
+        assert(!IsArray && "Returning array from a function!");
----------------
dcoughlin wrote:
> I don't understand why you are using makeZeroElementRegion() here. Doesn't the assertion of !IsArray mean it must just return 'V'?
Hmm. Right. I mis-remembered that it's also modeling a cast.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55804/new/

https://reviews.llvm.org/D55804





More information about the cfe-commits mailing list