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:
parent
a2120947bb
commit
a88e567e00
@ -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 ?
|
||||
|
Loading…
Reference in New Issue
Block a user