Fix bug: SimplifyCFG/2003-08-05-InvokeCrash.ll
authorChris Lattner <sabre@nondot.org>
Tue, 5 Aug 2003 16:27:44 +0000 (16:27 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 5 Aug 2003 16:27:44 +0000 (16:27 +0000)
Fix bug: SimplifyCFG/2003-08-05-MishandleInvoke.ll

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

lib/Transforms/Utils/SimplifyCFG.cpp

index e1910446de2ac7e3781a6e740f74a8e553dfc8db..1adbef9253a041bf28a65159b7bdd7de604a350f 100644 (file)
@@ -201,7 +201,8 @@ bool SimplifyCFG(BasicBlock *BB) {
       }
   
     BasicBlock *OnlySucc = 0;
-    if (OnlyPred && OnlyPred != BB) {   // Don't break self loops
+    if (OnlyPred && OnlyPred != BB &&    // Don't break self loops
+        OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) {
       // Check to see if there is only one distinct successor...
       succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred));
       OnlySucc = BB;