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

Devin Coughlin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 18 20:13:17 PST 2018


dcoughlin accepted this revision.
dcoughlin added a comment.
This revision is now accepted and ready to land.

This seems reasonable to me, although I have a question inline about why you are using `makeZeroElementRegion()`.



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


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

https://reviews.llvm.org/D55804





More information about the cfe-commits mailing list