[PATCH] D158707: [analyzer] Fix a few size-type signedness inconsistency related to DynamicExtent

Ding Fei via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 23 23:10:30 PDT 2023


danix800 created this revision.
danix800 added a project: clang.
Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
danix800 requested review of this revision.
Herald added a subscriber: cfe-commits.

Size-type inconsistency (signedness) causes confusion and even bugs.
For example when signed compared to unsigned the result might not
be expected.

Releted checkers:

1. ArrayBoundCheckerV2: signed compared to unsigned
2. MPIChecker: `MPI_Waitall` should respect `count` arg
3. ExprInspection: use more general API to report more results

Fixes https://github.com/llvm/llvm-project/issues/64920


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158707

Files:
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicExtent.h
  clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
  clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
  clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.cpp
  clang/lib/StaticAnalyzer/Core/DynamicExtent.cpp
  clang/test/Analysis/array-bound-v2-constraint-check.c
  clang/test/Analysis/flexible-array-members.c
  clang/test/Analysis/memory-model.cpp
  clang/test/Analysis/mpichecker.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158707.552998.patch
Type: text/x-patch
Size: 16240 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230824/efce6d7d/attachment.bin>


More information about the cfe-commits mailing list