[PATCH] D25940: [analyzer] LibraryFunctions: Fix errors due to different integral types and typedefs on different architectures.

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 07:42:03 PDT 2016


NoQ updated this revision to Diff 76031.
NoQ marked 2 inline comments as done.
NoQ added a comment.

In https://reviews.llvm.org/D25940#579227, @dcoughlin wrote:

> Are the parameter types actually needed? I think in general the rest of the analyzer uses arity alone.


Arity checks are to avoid crashes `getArg...()`. I'm also avoiding assertion failures on `APSInt` manipulations, which must be of the same type. And even if `APSInt`s didn't assert-fail and were promoted correctly automatically in all operations, we would still want to avoid mismatching types, because results may be completely unexpected.

All right, yep, i'm getting the point about overrides. It's true that we need to find the correct functions better, rather than match more functions. Trying that in the new revision.


https://reviews.llvm.org/D25940

Files:
  lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
  test/Analysis/std-c-library-functions.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25940.76031.patch
Type: text/x-patch
Size: 7163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161027/8a2c52a3/attachment-0001.bin>


More information about the cfe-commits mailing list