[PATCH] D148355: [analyzer] Fix comparison logic in ArrayBoundCheckerV2

DonĂ¡t Nagy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 07:40:47 PDT 2023


donat.nagy updated this revision to Diff 515326.
donat.nagy edited the summary of this revision.
donat.nagy added a comment.

I'm publishing the extended variant of this commit (which I mentioned in earlier comments).

This generalizes the first version of the commit to check for the unsigned-vs-negative comparison on both bound checks (and eliminates the code duplication between the two bound checks by moving their logic into a helper function), so it will behave similarly to Tomasz's solution (which uses the indirect "use 0 instead of negative numbers" trick to avoid unsigned-vs-negative comparisons).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148355

Files:
  clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
  clang/test/Analysis/array-bound-v2-constraint-check.c
  clang/test/Analysis/out-of-bounds-false-positive.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148355.515326.patch
Type: text/x-patch
Size: 9605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230420/9d39354e/attachment.bin>


More information about the cfe-commits mailing list