summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-29 22:01:51 +0000
committerChris Lattner <sabre@nondot.org>2004-02-29 22:01:51 +0000
commit92bc3bc11c2d439264b1cf9e7fc5bc79f4215a54 (patch)
tree1968b15fc7c2f48e6d83ae0847281803d73eaa21 /lib/CodeGen/LiveVariables.cpp
parentc81295ab24ab3ea3d8203f4b798fa05c1b602a96 (diff)
downloadllvm-92bc3bc11c2d439264b1cf9e7fc5bc79f4215a54.tar.gz
llvm-92bc3bc11c2d439264b1cf9e7fc5bc79f4215a54.tar.bz2
llvm-92bc3bc11c2d439264b1cf9e7fc5bc79f4215a54.tar.xz
Add an assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r--lib/CodeGen/LiveVariables.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp
index 35c64e2548..10c215885f 100644
--- a/lib/CodeGen/LiveVariables.cpp
+++ b/lib/CodeGen/LiveVariables.cpp
@@ -277,7 +277,9 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
// PHI nodes are guaranteed to be at the top of the block...
for (MachineBasicBlock::iterator MI = Succ->begin(), ME = Succ->end();
MI != ME && MI->getOpcode() == TargetInstrInfo::PHI; ++MI) {
- for (unsigned i = 1; ; i += 2)
+ for (unsigned i = 1; ; i += 2) {
+ assert(MI->getNumOperands() > i+1 &&
+ "Didn't find an entry for our predecessor??");
if (MI->getOperand(i+1).getMachineBasicBlock() == MBB) {
MachineOperand &MO = MI->getOperand(i);
if (!MO.getVRegValueOrNull()) {
@@ -288,6 +290,7 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
break; // Found the PHI entry for this block...
}
}
+ }
}
}