mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 14:47:00 +00:00
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
This commit is contained in:
parent
12cfa11960
commit
f1bb42152a
@ -134,10 +134,15 @@ AddCodeToMergeInOperand(Record *R, BitsInit *BI, const std::string &VarName,
|
||||
assert(!CGI.Operands.isFlatOperandNotEmitted(OpIdx) &&
|
||||
"Explicitly used operand also marked as not emitted!");
|
||||
} else {
|
||||
unsigned NumberOps = CGI.Operands.size();
|
||||
/// If this operand is not supposed to be emitted by the
|
||||
/// generated emitter, skip it.
|
||||
while (CGI.Operands.isFlatOperandNotEmitted(NumberedOp))
|
||||
while (NumberedOp < NumberOps &&
|
||||
CGI.Operands.isFlatOperandNotEmitted(NumberedOp))
|
||||
++NumberedOp;
|
||||
// If this operand has not been found, ignore it.
|
||||
if (NumberedOp >= NumberOps)
|
||||
return;
|
||||
OpIdx = NumberedOp++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user