[llvm] b7165fd - [llvm][ARM] Fix bounds check after use in ARMAsmParser
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 02:53:13 PDT 2023
Author: David Spickett
Date: 2023-03-22T09:49:02Z
New Revision: b7165fdc7ecaa5fa77849066d4307d45ac026a9d
URL: https://github.com/llvm/llvm-project/commit/b7165fdc7ecaa5fa77849066d4307d45ac026a9d
DIFF: https://github.com/llvm/llvm-project/commit/b7165fdc7ecaa5fa77849066d4307d45ac026a9d.diff
LOG: [llvm][ARM] Fix bounds check after use in ARMAsmParser
Fixes #61605
Added:
Modified:
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 7ce9e04657c7d..e0bc431fd4bd8 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -11007,7 +11007,7 @@ unsigned ARMAsmParser::checkTargetMatchPredicate(MCInst &Inst) {
// Find the optional-def operand (cc_out).
unsigned OpNo;
for (OpNo = 0;
- !MCID.operands()[OpNo].isOptionalDef() && OpNo < MCID.NumOperands;
+ OpNo < MCID.NumOperands && !MCID.operands()[OpNo].isOptionalDef();
++OpNo)
;
// If we're parsing Thumb1, reject it completely.
More information about the llvm-commits
mailing list