llvm.org GIT mirror llvm / f1bb421
Fix issue with invalid flat operand number Avoid iterating over list of operands beyond the number of operands in it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167634 91177308-0d34-0410-b5e6-96231b3b80d8 Evandro Menezes 8 years ago
1 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
133133 assert(!CGI.Operands.isFlatOperandNotEmitted(OpIdx) &&
134134 "Explicitly used operand also marked as not emitted!");
135135 } else {
136 unsigned NumberOps = CGI.Operands.size();
136137 /// If this operand is not supposed to be emitted by the
137138 /// generated emitter, skip it.
138 while (CGI.Operands.isFlatOperandNotEmitted(NumberedOp))
139 while (NumberedOp < NumberOps &&
140 CGI.Operands.isFlatOperandNotEmitted(NumberedOp))
139141 ++NumberedOp;
142 // If this operand has not been found, ignore it.
143 if (NumberedOp >= NumberOps)
144 return;
140145 OpIdx = NumberedOp++;
141146 }
142147