[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

Tomasz KamiƄski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 18 00:55:11 PDT 2022


tomasz-kaminski-sonarsource added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:753
 
-    SVal V = computeObjectUnderConstruction(E, State, LCtx, CC, CallOpts, Idx);
+    SVal V = computeObjectUnderConstruction(E, State, currBldrCtx, LCtx, CC,
+                                            CallOpts, Idx);
----------------
tomasz-kaminski-sonarsource wrote:
> NoQ wrote:
> > You probably want an updated builder context here as well. This function should be a simple wrapper, it should be completely interchangeable with calling both functions directly.
> Could you please elaborate more? I would see a reason to create a context here if I would expect that `currBlrdCtx` refers to a different `Block` that we want to perform construction in. And there is no indication on another `Block` being inplay here, and I would construct `NodeBlockCtx` with same block as `currBldrCtx`.
> In other words,  I expect this function to be `handeConstructionContext` in current `Block`. 
Or to say it differently, I expect `BldCtx` not being `currBldrCtx` to be an unusual situation, that is limited to the construction of return value. Thus having it in `convenience` would only make it more currbesome.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132030



More information about the cfe-commits mailing list