]> granicus.if.org Git - clang/commitdiff
Add a short circuit in isVirtuallyDerivedFrom.
authorAnders Carlsson <andersca@mac.com>
Fri, 4 Jun 2010 01:40:08 +0000 (01:40 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 4 Jun 2010 01:40:08 +0000 (01:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105457 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/CXXInheritance.cpp

index bdba01402c35c6d0390156fc4e0b643c603e4f8c..c563c37d58f45ea4d98036017c1865bf60b8690c 100644 (file)
@@ -90,6 +90,9 @@ bool CXXRecordDecl::isDerivedFrom(CXXRecordDecl *Base, CXXBasePaths &Paths) cons
 }
 
 bool CXXRecordDecl::isVirtuallyDerivedFrom(CXXRecordDecl *Base) const {
+  if (!getNumVBases())
+    return false;
+
   CXXBasePaths Paths(/*FindAmbiguities=*/false, /*RecordPaths=*/false,
                      /*DetectVirtual=*/false);