]> granicus.if.org Git - clang/commitdiff
[analyzer] Don't try to devirtualize if the class is incomplete.
authorJordan Rose <jordan_rose@apple.com>
Wed, 15 Aug 2012 17:33:37 +0000 (17:33 +0000)
committerJordan Rose <jordan_rose@apple.com>
Wed, 15 Aug 2012 17:33:37 +0000 (17:33 +0000)
A similar issue to the previous commit, introduced by r161915.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161961 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/CallEvent.cpp

index c625f24e07f8af9b7cbad58fda9ff3310076742d..8481cd9c3396e653431b32e4c14f0ccc446ea8d6 100644 (file)
@@ -401,7 +401,7 @@ RuntimeDefinition CXXInstanceCall::getRuntimeDefinition() const {
   // Is the type a C++ class? (This is mostly a defensive check.)
   QualType RegionType = DynType.getType()->getPointeeType();
   const CXXRecordDecl *RD = RegionType->getAsCXXRecordDecl();
-  if (!RD)
+  if (!RD || !RD->hasDefinition())
     return RuntimeDefinition();
 
   // Find the decl for this method in that class.