mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-26 14:15:53 +00:00
Do not crash when deleing a region with a dead invoke instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10161 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8bc098be0c
commit
c8ecd22037
@ -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