[PATCH] D61816: [CFG] [analyzer] pr41300: Add a branch to skip virtual base initializers when they are handled by the superclass.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 24 15:58:31 PDT 2019


NoQ marked an inline comment as done.
NoQ added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:451
+  if (const auto *CallerCtor = dyn_cast_or_null<CXXConstructExpr>(
+          LCtx->getStackFrame()->getCallSite())) {
+    switch (CallerCtor->getConstructionKind()) {
----------------
Charusso wrote:
> NoQ wrote:
> > Charusso wrote:
> > > May it is worth to handle the call outside to see whether it is non-null.
> > Mmm, what do you mean?
> It was that which is `null`-proof:
> ```
> if (const Stmt *Outer = LCtx->getStackFrame()->getCallSite()) {
>   const CXXConstructExpr *OuterCtor = dyn_cast<CXXConstructExpr>(Outer);
>   if (OuterCtor) {
>     // ...
>   }
> }
> ```
That's exactly what `_or_null` stands for in `dyn_cast_or_null`.


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

https://reviews.llvm.org/D61816





More information about the cfe-commits mailing list