diff options
Diffstat (limited to 'lib/Transforms/IPO/DeadArgumentElimination.cpp')
-rw-r--r-- | lib/Transforms/IPO/DeadArgumentElimination.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 9f2b2a733e..ab8df69845 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -802,8 +802,11 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) { "Return type changed, but not into a void. The old return type" " must have been a struct!"); Instruction *InsertPt = Call; - if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) + if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) { InsertPt = II->getNormalDest()->begin(); + assert(!isa<PHINode>(InsertPt) && + "Can't have a use of the invoke value if the edge is critical"); + } // We used to return a struct. Instead of doing smart stuff with all the // uses of this struct, we will just rebuild it using |