From 9407cd4ede3e2c090b958778d0fdbdac8b2dbec4 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 15 Apr 2009 17:59:11 +0000 Subject: [PATCH] Fix MachineInstr::getNumExplicitOperands to count variadic operands correctly. Patch by Jakob Stoklund Olesen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69190 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineInstr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index a934b76b6d5..4e5229fad0e 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -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++; } -- 2.34.1