add an assert
authorChris Lattner <sabre@nondot.org>
Sat, 28 Oct 2006 18:11:20 +0000 (18:11 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Oct 2006 18:11:20 +0000 (18:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31267 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineFunction.cpp

index 205414e7264cc3c4b0d0b7b614a547e2be40efa3..7617de962d733d72aff91608162beccb7ab88d23 100644 (file)
@@ -363,6 +363,7 @@ void MachineFrameInfo::dump(const MachineFunction &MF) const {
 ///
 unsigned MachineJumpTableInfo::getJumpTableIndex(
                                      std::vector<MachineBasicBlock*> &DestBBs) {
+  assert(!DestBBs.empty() && "Cannot create an empty jump table!");
   for (unsigned i = 0, e = JumpTables.size(); i != e; ++i)
     if (JumpTables[i].MBBs == DestBBs)
       return i;