[PATCH] D46146: [analyzer] pr37152: Fix operator delete[] array-type-sub-expression handling.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 26 15:42:03 PDT 2018


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:1089-1091
+    // Yes, it may even be a multi-dimensional array.
+    while (const auto *AT = getContext().getAsArrayType(DTy))
+      DTy = AT->getElementType();
----------------
alexfh wrote:
> Maybe add a FIXME to model multiple destructor calls?
Yep, we already have one a few lines above, for all kinds of destructors. The new code is not about supporting array delete in general; it's about supporting the situation when the sub-//expression// of the delete operator is of an array type, so there's nothing new here with respect to actually calling multiple destructors.


Repository:
  rC Clang

https://reviews.llvm.org/D46146





More information about the cfe-commits mailing list