[PATCH] D75529: [analyzer] Limit UCharMax to min of max uchar or max int

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 3 09:06:03 PST 2020


martong accepted this revision.
martong added a comment.
This revision is now accepted and ready to land.

Looks good to me! Thanks!



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:514
+  // Set UCharMax to min of int or uchar maximum value.
+  // The C standard states that functions like isalpha must be representable
+  // as an unsigned char. Their type is 'int', so the max value of the
----------------
Perhaps it would be more precise to refer to the argument of these functions. So `The C standard states that the arguments of functions like isalpha must be representable ...`


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:517
+  // argument should be min(UCharMax, IntMax). This just happen to be true
+  // for commonly used and well tested ISAs, but not for others. 
+  const RangeInt UCharMax = std::min(
----------------
Could you please spell out `ISA`? Maybe it is just me but I don't know what that stands for.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75529





More information about the cfe-commits mailing list