]> granicus.if.org Git - clang/commitdiff
Add a sanity assertion so that we don't silently generate bad code; I'll file
authorEli Friedman <eli.friedman@gmail.com>
Sun, 27 Dec 2009 07:02:50 +0000 (07:02 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sun, 27 Dec 2009 07:02:50 +0000 (07:02 +0000)
a bug with a testcase hitting this assertion in a moment.

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

lib/CodeGen/CGCXX.cpp

index 81dd534ba6946a78d26af9d0425ac998d885c95b..cc006d9dd6c1b8829037e0b085382205d3ccd131 100644 (file)
@@ -1108,6 +1108,8 @@ void CodeGenFunction::InitializeVtablePtrsRecursive(
   }
 
   // Compute the address point
+  assert(AddressPoints.count(std::make_pair(ClassDecl, Offset)) &&
+         "Missing address point for class");
   uint64_t AddressPoint = AddressPoints[std::make_pair(ClassDecl, Offset)];
   llvm::Value *VtableAddressPoint =
       Builder.CreateConstInBoundsGEP2_64(Vtable, 0, AddressPoint);