aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-12-03 21:50:58 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-12-03 21:50:58 +0000
commit9aed9396a672f50541dc77a4662bb882a0fb1080 (patch)
tree592062cb1dbc25a3c477efaf9d0e1bedc34ae86d /lib/CodeGen/MachineInstr.cpp
parent4a8ee23a8181f668dc294b417f67e1675ad391ab (diff)
Watch out for PHI instruction with no source operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index ba9be6a870..2cafbd418f 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -1064,6 +1064,8 @@ bool MachineInstr::isInvariantLoad(AliasAnalysis *AA) const {
unsigned MachineInstr::isConstantValuePHI() const {
if (getOpcode() != TargetInstrInfo::PHI)
return 0;
+ if (getNumOperands() <= 1)
+ return 0;
unsigned Reg = getOperand(1).getReg();
for (unsigned i = 3, e = getNumOperands(); i < e; i += 2)