diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-29 22:01:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-29 22:01:51 +0000 |
commit | 604cc83933b2f0bb011f606c1afc92c19970de7f (patch) | |
tree | e28d6b9998c9790c988093056450657bbd60836e /llvm/lib/CodeGen/LiveVariables.cpp | |
parent | e0c3c18802214211ac5d3074375c0922783f3a49 (diff) | |
download | bcm5719-llvm-604cc83933b2f0bb011f606c1afc92c19970de7f.tar.gz bcm5719-llvm-604cc83933b2f0bb011f606c1afc92c19970de7f.zip |
Add an assert
llvm-svn: 12010
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveVariables.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp index 35c64e25484..10c215885f7 100644 --- a/llvm/lib/CodeGen/LiveVariables.cpp +++ b/llvm/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... } } + } } } |