[PATCH] D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 14 08:05:14 PST 2020


balazske added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:403
+    return;
+  case nonloc::ConcreteIntKind: {
+
----------------
This check works now with concrete int values. We have a known value and a list of ranges with known limits, so testing for //in any of the ranges// does work the same way as testing for //out of all ranges//. And testing if the value is inside one of the ranges is more simple code.

But I think the symbolic evaluation with "eval" and "assume" functions would be more generic here (and more simple code). Then the way of cutting-of the bad ranges is usable (probably still there is other solution).


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:464
+}
+
 void StdLibraryFunctionsChecker::checkPostCall(const CallEvent &Call,
----------------
If `evalCall` is used it could be more simple to test and apply the constraints for arguments and return value in a "single step".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73898





More information about the cfe-commits mailing list