aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/VirtRegMap.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-03-27 00:48:28 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-03-27 00:48:28 +0000
commit018d6e153768b382ac663164d91e2ea539e7cb0e (patch)
treedd0a846bd999dc056878e0b76aec85a8e2512ac0 /lib/CodeGen/VirtRegMap.cpp
parent40d2cd13a59f66581773e235ca6fbe383f6e68ac (diff)
Don't call getOperandConstraint() if operand index is greater than
TID->numOperands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.cpp')
-rw-r--r--lib/CodeGen/VirtRegMap.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 6fcbcf24fc..2532fa31c8 100644
--- a/lib/CodeGen/VirtRegMap.cpp
+++ b/lib/CodeGen/VirtRegMap.cpp
@@ -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));