[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 02:53:15 PDT 2020


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


================
Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:138-139
       SVal ThisVal = State->getSVal(ThisPtr);
+      if (Init->isBaseInitializer() || Init->isDelegatingInitializer())
+        return ThisVal;
 
----------------
NoQ wrote:
> For base initializer you probably want the base class region. It may have a non-trivial offset and it also has the correct type and extent.
Thank you for noticing this! You are completely right! Now I extended the tests with comparing the type of the returned region with the type of the expression. It failed when I just returned `ThisVal` but it passes with the fixed code.


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

https://reviews.llvm.org/D85351



More information about the cfe-commits mailing list