[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach
Balogh, Ádám via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 25 09:05:42 PDT 2020
baloghadamsoftware added a comment.
This is an alternative approach to D79704 <https://reviews.llvm.org/D79704>. The advantage is that we must not duplicate code everywhere where `VarRegion` (and sometimes also `DeclRegion`) is used. The drawback is that after we implement handling of parameters of functions without `Decl` (paramters of unknown functions passed by pointer) the `getDecl()` method may return `nullptr`. We must handle this case everywhere in the code where `VarRegion` or `DeclRegion` is used and parameters of such functions may appear. (We should do this in the original apprach as well, but there it is more difficult to forget such a place because `ParamRegion` is used explicitly. Furthermore, where handling of `ParamRegion` is completely forgotten we usually do not crash, but if we forget to check the result of `getDecl()` for `nullptr` we get null pointer dereferences.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80522/new/
https://reviews.llvm.org/D80522
More information about the cfe-commits
mailing list