[PATCH] D158813: [analyzer] MPIChecker: MPI_Waitall should respect count arg

Ding Fei via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 25 09:41:33 PDT 2023


danix800 added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.cpp:189-190
+        ASTCtx.getCharWidth();
+    const NonLoc MROffset =
+        SVB.makeArrayIndex(MR->getAsOffset().getOffset() / ElemSizeInBits);
 
----------------
steakhal wrote:
> What implies that `MR->getAsOffset()` succeeds, and also what implies that the `Offset` within that is not symbolic?
> Also, how can you use this without also using the result region?
> Without using that you don't know what is the anchor point, from which this offset represent anything.
> ATM I believe the code assumes that `MR->getRegion()` equals to `SuperRegion`, which might not be always the case.
> This could materialize a problem when you construct the element region later.
I'll restrict the checker to handle non-symbolic offset only.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158813



More information about the cfe-commits mailing list