[PATCH] D31982: [analyzer] Improve suppression for inlined defensive checks when operator& is involved.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 06:46:52 PDT 2017


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:977
+          Ex = Op->getSubExpr()->IgnoreParenCasts();
+          while (true) {
+            if (const auto *ME = dyn_cast<MemberExpr>(Ex)) {
----------------
zaks.anna wrote:
> Why do we need the "while (true)"? Can we just use "dyn_cast<MemberExpr>(Ex)" as the loop condition?
> 
> Take a look at the getDerefExpr(const Stmt *S) and see if that would be a better place to add this code. Maybe not..
> 
Accidentally clicked "Done" and forgot about the `getDerefExpr()` part.

I put it into a follow-up patch though: D32291, because it's quite a cascade of changes already.


https://reviews.llvm.org/D31982





More information about the cfe-commits mailing list