[PATCH] D87043: [Analyzer] Fix for dereferece of smart pointer after branching on unknown inner pointer

Nithin VR via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 14:01:05 PDT 2020


vrnithinkumar marked an inline comment as done.
vrnithinkumar added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:106
   const auto *InnerPointVal = State->get<TrackedRegionMap>(ThisRegion);
-  return InnerPointVal && InnerPointVal->isZeroConstant();
+  return InnerPointVal && State->isNull(*InnerPointVal).isConstrainedTrue();
 }
----------------
NoQ wrote:
> The intended ultimate test is `!State->assume(X)` and it's also much easier to write. I strongly suspect that we should remove these other APIs; they're only confusing.
Sorry for addressing the pending comment so late. :(
I was busy with my postponed exams. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87043



More information about the cfe-commits mailing list