1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Fix MachineInstr::getNumExplicitOperands to count

variadic operands correctly. Patch by Jakob Stoklund Olesen!

llvm-svn: 69190
This commit is contained in:
Dan Gohman 2009-04-15 17:59:11 +00:00
parent c4bf4ef9cc
commit 420019a18a

View File

@ -623,8 +623,8 @@ unsigned MachineInstr::getNumExplicitOperands() const {
if (!TID->isVariadic())
return NumOperands;
for (unsigned e = getNumOperands(); NumOperands != e; ++NumOperands) {
const MachineOperand &MO = getOperand(NumOperands);
for (unsigned i = NumOperands, e = getNumOperands(); i != e; ++i) {
const MachineOperand &MO = getOperand(i);
if (!MO.isReg() || !MO.isImplicit())
NumOperands++;
}