RedDocMD marked 2 inline comments as done.
RedDocMD added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrChecker.cpp:87
+  const ProgramStateRef BugState;
+  llvm::SmallPtrSet<const Expr *, 16> DoneExprs;
+
----------------
steakhal wrote:
> I'm not sure if we should expect 16 unique places where `uptr::get()` called 
> on a path. I would guess 4 or 2 is more than enough.
Ok


================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrChecker.cpp:106-109
+    if (const auto *DS = llvm::dyn_cast<DeclStmt>(S)) {
+      for (const Decl *D : DS->getDeclGroup()) {
+        if (const VarDecl *VD = llvm::dyn_cast<VarDecl>(D)) {
+          const Expr *Init = VD->getInit();
----------------
steakhal wrote:
> So you are trying to find the assignment, where the inner pointer is assigned 
> to a variable.
> This visitor logic seems to be somewhat convoluted.
> 
> What you want to achieve is slightly similar to `FindLastStoreBRVisitor`. You 
> should have a look at that.
That is what I had done before. @NoQ pointed out why this wouldn't work in a 
previous comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97183

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to