[PATCH] D34275: [analyzer] Re-implemente current virtual calls checker in a path-sensitive way

wangxin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 08:46:19 PDT 2017


wangxindsb added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp:332
+// Check the base of the callexpr is equal to the this of the ctor
+bool VirtualCallChecker::isCalledbyCtor(const CallExpr *CE,ProgramStateRef State,const LocationContext *LCtx) const {
+  if (const MemberExpr *CME = dyn_cast<MemberExpr>(CE->getCallee())) {
----------------
xazax.hun wrote:
> Maybe instead of callExpr, you should get CXXInstanceCall, which has a getCXXThisVal method. 
I tried to use the CXXInstanceCall, but I can't use it to get the expr which call the function.


https://reviews.llvm.org/D34275





More information about the cfe-commits mailing list