Don't call getOperandConstraint() if operand index is greater than
authorEvan Cheng <evan.cheng@apple.com>
Tue, 27 Mar 2007 00:48:28 +0000 (00:48 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 27 Mar 2007 00:48:28 +0000 (00:48 +0000)
TID->numOperands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35375 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/VirtRegMap.cpp

index 6fcbcf24fcb67e2ff71b6b7c609cce1488f9ef60..2532fa31c845a78bbfbe70aadf94f73c89cbaed4 100644 (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));