[PATCH] D19964: [scan-build] fix warnings emiited on LLVM Analysis code base

Apelete Seketeli via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 15:07:42 PDT 2016


apelete added inline comments.

================
Comment at: lib/Analysis/LoopInfo.cpp:548
@@ -547,2 +547,3 @@
     }
+    assert(Unloop && "does not contain any loop");
     if (L != Unloop && Unloop->contains(L)) {
----------------
apelete wrote:
> sbaranga wrote:
> > Would there be any reason to have this assert here and not at the top?
> Code path that leads to "Called C++ object pointer is null" is the one inside the for() loop on line 537.
> Not sure asserting outside that path would help, I'm going to verify that.
Tested moving the assert at the top of function, and I can confirm that it has no effect on the codepath inside the for() loop at line 537.

Would you prefer to have it at the beginning of the for() loop ?


http://reviews.llvm.org/D19964





More information about the llvm-commits mailing list