diff --git a/SMPFunction.cpp b/SMPFunction.cpp index e6d0a1bb67b814483e62a517a5d127acef0ca6f4..4212f05cac54de5e226d8c6c94c1cac6c0dddd7c 100644 --- a/SMPFunction.cpp +++ b/SMPFunction.cpp @@ -1423,6 +1423,11 @@ void SMPFunction::SetLinks(void) { for (SuccIter = CurrBlock->GetFirstSucc(); SuccIter != CurrBlock->GetLastSucc(); ++SuccIter) { (*SuccIter)->ErasePred(TempAddr); } + // Remove the unreachable instructions from the function inst list. + list<list<SMPInstr>::iterator>::iterator InstIter; + for (InstIter = CurrBlock->GetFirstInstr(); InstIter != CurrBlock->GetLastInstr(); ++InstIter) { + list<SMPInstr>::iterator DummyIter = this->Instrs.erase(*InstIter); + } // Finally, remove the block from the blocks list. CurrBlock = this->Blocks.erase(CurrBlock); this->BlockCount -= 1;