1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

Do not crash when deleing a region with a dead invoke instruction

llvm-svn: 10161
This commit is contained in:
Chris Lattner 2003-11-22 02:13:08 +00:00
parent a2120947bb
commit a88e567e00

View File

@ -430,6 +430,10 @@ bool ADCE::doADCE() {
}
// Delete the old terminator instruction...
const Type *TermTy = BB->getTerminator()->getType();
if (TermTy != Type::VoidTy)
BB->getTerminator()->replaceAllUsesWith(
Constant::getNullValue(TermTy));
BB->getInstList().pop_back();
const Type *RetTy = Func->getReturnType();
new ReturnInst(RetTy != Type::VoidTy ?