Make sure that the register is in the register class before adding it as a machine op.

llvm-svn: 142021
This commit is contained in:
Bill Wendling 2011-10-14 23:55:44 +00:00
parent 4191045be4
commit b1bbf0394f

View File

@ -5921,9 +5921,11 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const {
MachineInstrBuilder MIB(&*II);
for (unsigned i = 0; SavedRegs[i] != 0; ++i)
for (unsigned i = 0; SavedRegs[i] != 0; ++i) {
if (!TRC->contains(SavedRegs[i])) continue;
if (!DefRegs[SavedRegs[i]])
MIB.addReg(SavedRegs[i], RegState::Implicit | RegState::Define);
}
break;
}