Fix a bug which occurred with empty basic blocks

llvm-svn: 5982
This commit is contained in:
Chris Lattner 2003-05-02 18:44:42 +00:00
parent e22031edfe
commit f22d1f5912
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
const TargetInstrInfo &TII = Fn.getTarget().getInstrInfo();
for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI) {
// If last instruction is a return instruction, add an epilogue
if (TII.isReturn(FI->back()->getOpcode())) {
if (!FI->empty() && TII.isReturn(FI->back()->getOpcode())) {
MBB = FI; I = MBB->end()-1;
for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) {