[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 06:35:41 PST 2020


Szelethus added a comment.

In D75514#1907392 <https://reviews.llvm.org/D75514#1907392>, @baloghadamsoftware wrote:

> In D75514#1905268 <https://reviews.llvm.org/D75514#1905268>, @Szelethus wrote:
>
> > But why is this related to `UndefinedVal`?
>
>
> Because `UndefinedVal` seems to be the "null" value of `SVal` thus it is suitable for default value of the parameter.


Shouldn't we use `Optional` then? `None` means something completely different then `UndefinedVal`.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp:53-57
+  ExplodedNode *reportBug(llvm::StringRef Msg, CheckerContext &C,
+                          SVal ExprVal = UndefinedVal()) const;
   ExplodedNode *reportBug(llvm::StringRef Msg, BugReporter &BR,
-                          ExplodedNode *N) const;
+                          ExplodedNode *N,
+                          SVal ExprVal = UndefinedVal()) const;
----------------
I would also prefer to comment what happens when `ExprVal` has a special value, because its non-obvious from the declaration.


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

https://reviews.llvm.org/D75514





More information about the cfe-commits mailing list