mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-26 09:49:48 +00:00
X86FoldTablesEmitter - fix static analyzer potential invalid iterator warning. NFCI.
This commit is contained in:
parent
37cdac6344
commit
cfc385d954
@ -618,14 +618,14 @@ void X86FoldTablesEmitter::run(formatted_raw_ostream &OS) {
|
||||
uint8_t Opc =
|
||||
getValueFromBitsInit(MemInst->TheDef->getValueAsBitsInit("Opcode"));
|
||||
|
||||
if (RegInsts.count(Opc) == 0)
|
||||
auto RegInstsIt = RegInsts.find(Opc);
|
||||
if (RegInstsIt == RegInsts.end())
|
||||
continue;
|
||||
|
||||
// Two forms (memory & register) of the same instruction must have the same
|
||||
// opcode. try matching only with register form instructions with the same
|
||||
// opcode.
|
||||
std::vector<const CodeGenInstruction *> &OpcRegInsts =
|
||||
RegInsts.find(Opc)->second;
|
||||
std::vector<const CodeGenInstruction *> &OpcRegInsts = RegInstsIt->second;
|
||||
|
||||
auto Match = find_if(OpcRegInsts, IsMatch(MemInst, Records));
|
||||
if (Match != OpcRegInsts.end()) {
|
||||
|
Loading…
Reference in New Issue
Block a user