[PATCH] D131067: [analyzer] Treat values passed as parameter as escaped

Thomas Weißschuh via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 20 23:56:19 PDT 2022


t-8ch added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:538
+                               CallExpr::const_arg_range Args) {
+    for (const auto &[Param, Arg] : llvm::zip(FD->parameters(), Args)) {
+      if (!Param->getType()->isReferenceType())
----------------
NoQ wrote:
> IIRC there are a few cases where parameters and arguments don't zip together nicely (cf. the hacks we needed to do in `CXXMemberOperatorCall::getAdjustedParameterIndex()`, `CXXMemberOperatorCall::::getASTArgumentIndex()`). 
Indeed. I added logic to handle it.
Unfortunately I didn't see how to use CXXMemberOperatorCall directly.
So I extracted the detection logic from CallEventManager::getSimpleCall() into isMemberOperatorCall().

Any hints on how to do this better are much appreciated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131067



More information about the cfe-commits mailing list