[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

Deep Majumder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 29 05:45:18 PDT 2021


RedDocMD added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:421-422
       const auto *TrackingExpr = Call.getArgExpr(0);
-      assert(TrackingExpr->getType()->isPointerType() &&
-             "Adding a non pointer value to TrackedRegionMap");
+      if (TrackingExpr->getType()->isPointerType())
+        return false;
       auto ArgVal = Call.getArgSVal(0);
----------------
vsavchenko wrote:
> Okay, I'm either missing something or this condition is missing `!` here.
And that's the ghost bug I am chasing around for the last few hours.
Thanks :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105821



More information about the cfe-commits mailing list