[PATCH] D131170: [clang][dataflow] Analyze method bodies
Stanislav Gatev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 4 08:58:05 PDT 2022
sgatev added inline comments.
================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:217
+ const Expr *Arg = MethodCall->getImplicitObjectArgument();
+ Env.ThisPointeeLoc = Env.getStorageLocation(*Arg, SkipPast::Reference);
+ }
----------------
samestep wrote:
> sgatev wrote:
> > samestep wrote:
> > > sgatev wrote:
> > > > What if `Arg` is null?
> > > Good point, thanks; under what circumstances can that happen? In any case, I'm adding a guard for this.
> > It can be null if the argument isn't modeled and there's no value assigned to its storage location.
> Hmm I don't quite follow; `Arg` just comes from calling `getImplicitObjectArgument` on the `CXXMemberCallExpr`, right? So shouldn't it only depend on the AST, and be completely independent of what we do or don't model?
Ah, right. Well, I'm not familiar with the details, but apparently it returns null in some cases.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131170/new/
https://reviews.llvm.org/D131170
More information about the cfe-commits
mailing list