Don't call getOperandConstraint() if operand index is greater than

TID->numOperands.

llvm-svn: 35375
This commit is contained in:
Evan Cheng 2007-03-27 00:48:28 +00:00
parent 2850c677af
commit fdbdf43632
1 changed files with 2 additions and 1 deletions

View File

@ -965,7 +965,8 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM,
if (WasKill) {
const TargetInstrDescriptor *NTID =
NextMII->getInstrDescriptor();
if (NTID->getOperandConstraint(UIdx, TOI::TIED_TO) == -1)
if (UIdx >= NTID->numOperands ||
NTID->getOperandConstraint(UIdx, TOI::TIED_TO) == -1)
MOU.setIsKill();
}
Spills.addLastUse(InReg, &(*NextMII));