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

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 6 15:40:21 PST 2020


xazax.hun added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:401
+    return;
+  case nonloc::ConcreteIntKind: {
+    const llvm::APSInt &IntVal = V.castAs<nonloc::ConcreteInt>().getValue();
----------------
Dealing with only concrete ints might be a good start but we might want to handle symbolic cases in the future like:

```
if (v > 255) 
  return isalpha(v);
```

I am ok with not addig this in the first version but adding TODOs and test cases upfront cannot hurt.

So basivally, I was wondering if we should query the solver for the result instead of matching the sval kind and just early return if we do not want to support a specific kind.


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