summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorEvandro Menezes <emenezes@codeaurora.org>2012-11-09 21:27:03 +0000
committerEvandro Menezes <emenezes@codeaurora.org>2012-11-09 21:27:03 +0000
commitf1adbfe4e23ce08d1afa1245f2515e863813a6ac (patch)
tree5b8ed3ea6f86667445fe8b243c755dd69ae6d6ab /utils
parentf1bb42152a0375f2889bd7329eada2b6422c837e (diff)
downloadllvm-f1adbfe4e23ce08d1afa1245f2515e863813a6ac.tar.gz
llvm-f1adbfe4e23ce08d1afa1245f2515e863813a6ac.tar.bz2
llvm-f1adbfe4e23ce08d1afa1245f2515e863813a6ac.tar.xz
Fix issue with invalid flat operand number
Avoid iterating over list of operands beyond the number of operands in it. PS: this fixes issue with revision #167634. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/CodeEmitterGen.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp
index bcca15cd57..3e4f626d48 100644
--- a/utils/TableGen/CodeEmitterGen.cpp
+++ b/utils/TableGen/CodeEmitterGen.cpp
@@ -140,9 +140,7 @@ AddCodeToMergeInOperand(Record *R, BitsInit *BI, const std::string &VarName,
while (NumberedOp < NumberOps &&
CGI.Operands.isFlatOperandNotEmitted(NumberedOp))
++NumberedOp;
- // If this operand has not been found, ignore it.
- if (NumberedOp >= NumberOps)
- return;
+
OpIdx = NumberedOp++;
}