Check in the file I forgot last night, to solve all of the crashes in every
authorChris Lattner <sabre@nondot.org>
Sat, 11 Dec 2004 22:10:29 +0000 (22:10 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 11 Dec 2004 22:10:29 +0000 (22:10 +0000)
test in the suite.  :(

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

lib/VMCore/BasicBlock.cpp

index 2e8560cb65779dba97d99462cc28064809bec782..b399c552210fef6b20987b7ead7201266a9f24a7 100644 (file)
@@ -138,6 +138,7 @@ void BasicBlock::dropAllReferences() {
 void BasicBlock::removePredecessor(BasicBlock *Pred) {
   assert(find(pred_begin(this), pred_end(this), Pred) != pred_end(this) &&
         "removePredecessor: BB is not a predecessor!");
+  if (InstList.empty()) return;
   PHINode *APN = dyn_cast<PHINode>(&front());
   if (!APN) return;   // Quick exit.