[PATCH] D19962: [scan-build] fix warnings emitted on Clang StaticAnalyzer code base
Anna Zaks via cfe-commits
cfe-commits at lists.llvm.org
Mon May 9 21:55:22 PDT 2016
zaks.anna added inline comments.
================
Comment at: lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp:686
@@ -685,3 +685,3 @@
const Expr *ArgExpr = nullptr;
if (Idx < Call.getNumArgs())
ArgExpr = Call.getArgExpr(Idx);
----------------
This conditional will assert if:
assert(Arg < NumArgs && "Arg access out of range!");
So removing this conditional will assert in the same cases as the assert you are adding.
================
Comment at: lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp:696
@@ -695,1 +695,3 @@
+ assert(ArgExpr && "cannot get the type of a NULL expression");
+
----------------
Asserting might not be the right thing to do here.
http://reviews.llvm.org/D19962
More information about the cfe-commits
mailing list