Author: xazax Date: Thu Sep 21 01:18:59 2017 New Revision: 313866 URL: http://llvm.org/viewvc/llvm-project?rev=313866&view=rev Log: [analyzer] Fix an assertion fail in VirtualCallChecker
Differential Revision: https://reviews.llvm.org/D37978 Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp cfe/trunk/test/Analysis/virtualcall.cpp Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp?rev=313866&r1=313865&r2=313866&view=diff ============================================================================== --- cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp (original) +++ cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp Thu Sep 21 01:18:59 2017 @@ -146,7 +146,7 @@ static bool isVirtualCall(const CallExpr if (CME->getQualifier()) CallIsNonVirtual = true; - if (const Expr *Base = CME->getBase()->IgnoreImpCasts()) { + if (const Expr *Base = CME->getBase()) { // The most derived class is marked final. if (Base->getBestDynamicClassType()->hasAttr<FinalAttr>()) CallIsNonVirtual = true; Modified: cfe/trunk/test/Analysis/virtualcall.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/virtualcall.cpp?rev=313866&r1=313865&r2=313866&view=diff ============================================================================== --- cfe/trunk/test/Analysis/virtualcall.cpp (original) +++ cfe/trunk/test/Analysis/virtualcall.cpp Thu Sep 21 01:18:59 2017 @@ -271,3 +271,24 @@ int main() { #if !PUREONLY //expected-note-re@-2 2{{{{^}}Calling '~E'}} #endif + +namespace PR34451 { +struct a { + void b() { + a c[1]; + c->b(); + } +}; + +class e { + public: + void b() const; +}; + +class c { + void m_fn2() const; + e d[]; +}; + +void c::m_fn2() const { d->b(); } +} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits