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

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 6 10:28:58 PST 2020


martong marked 2 inline comments as done.
martong added a comment.

In D73898#1901142 <https://reviews.llvm.org/D73898#1901142>, @balazske wrote:

> Is it sure that the signedness in the ranges is handled correctly? The EOF is a negative value but the `RangeInt` is unsigned type. The `tryExpandAsInteger` returns `int` too that is put into an unsigned `RangeInt` later. Probably it is better to use `APSInt` for the ranges? (The problem exists already before this change.)


That is not a problem, because finally in `apply` we use an `APSInt` that is constructed by considering the correct `T` type, e.g.:

  const llvm::APSInt &Min = BVF.getValue(R[I].first, T);

We could consider `RangeInt` as a buffer that is big enough to hold the representation of the range values. The concrete interpretation of the bits (as `T`) is done by `APSInt`.


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