Erase instructions _after_ checking their type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132256 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2011-05-28 11:48:37 +00:00
parent 06a8d54967
commit 33858016ea

View File

@@ -532,13 +532,14 @@ bool DwarfEHPrepare::LowerUnwindsAndResumes() {
if (isa<UnwindInst>(RI)) if (isa<UnwindInst>(RI))
new UnreachableInst(RI->getContext(), RI); new UnreachableInst(RI->getContext(), RI);
// Nuke the resume instruction.
RI->eraseFromParent();
if (isa<UnwindInst>(RI)) if (isa<UnwindInst>(RI))
++NumUnwindsLowered; ++NumUnwindsLowered;
else else
++NumResumesLowered; ++NumResumesLowered;
// Nuke the resume instruction.
RI->eraseFromParent();
Changed = true; Changed = true;
} }