[PATCH] D75432: [analyzer][NFC][MallocChecker] Convert many parameters into CallEvent
Kristóf Umann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 20 07:02:16 PDT 2020
Szelethus marked 3 inline comments as done.
Szelethus added a comment.
I though I addressed the inlines months ago, but seems like I did not. I'll get this done post-commit. Oops.
================
Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1194
- if (!FD)
+ if (!Call.getOriginExpr())
return;
----------------
balazske wrote:
> This should be added to avoid later crash (probably not needed for every check kind?):
> ```
> const FunctionDecl *FD = C.getCalleeDecl(CE);
> if (!FD)
> return;
> ```
Not all `CallEvent`s have a corresponding `FunctionDecl` or a `CallExpr`, for instance, `CXXAllocatorCall` corresponds with `CXXNewExpr`, which is not a `CallExpr`, but it is handled by this checker. For this reason, I decided to move this check to the individual modeling functions.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75432/new/
https://reviews.llvm.org/D75432
More information about the cfe-commits
mailing list