From 018d6e153768b382ac663164d91e2ea539e7cb0e Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 27 Mar 2007 00:48:28 +0000 Subject: [PATCH] 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 --- lib/CodeGen/VirtRegMap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 6fcbcf24fcb..2532fa31c84 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)); -- 2.34.1