[PATCH] D51300: [analyzer][UninitializedObjectChecker] No longer using nonloc::LazyCompoundVal

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 28 13:18:02 PDT 2018


NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Yup, looks correct to me!



================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:448-449
 
   Loc ThisLoc = Context.getSValBuilder().getCXXThis(CtorDecl->getParent(),
                                                     Context.getStackFrame());
 
----------------
This totally needs `assert(CtorDecl == Context.getStackFrame()->getDecl())`. Otherwise we're in big trouble because we'll be looking into a this-region that doesn't exist on this stack frame.

On second thought, though, i guess we should put this assertion into the constructor of `CXXThisRegion`. I'll do this.

Also there's an overload of `getCXXThis` that accepts the method itself, no need to get parent.


Repository:
  rC Clang

https://reviews.llvm.org/D51300





More information about the cfe-commits mailing list