[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr
Valeriy Savchenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 29 05:52:54 PDT 2021
vsavchenko added inline comments.
================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:381
+ const MemRegion *ThisRegion = DC->getCXXThisVal().getAsRegion();
+ assert(ThisRegion && "We do not support explicit calls to destructor");
+ const auto *InnerPtrVal = State->get<TrackedRegionMap>(ThisRegion);
----------------
RedDocMD wrote:
> vsavchenko wrote:
> > And if it happens we are going to crash with assertion failure?
> Assuming assertions are enabled, that is.
We should never crash or fail on valid C++ code. We can abandon everything, forbid checker to report anything on a function that has something that we don't know how to handle properly, but never fail the overall analysis process because of that.
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