From b0225ab8fd4fff92f081da3fabcb635c8e67e5ca Mon Sep 17 00:00:00 2001 From: Aakanksha Date: Fri, 25 Mar 2022 11:33:25 +0000 Subject: [PATCH] Prevent comparison with wider type in loop condition This change fixes the code violations flagged in AMD compute CodeQL scan - "comparison-with-wider-type" Differential Revision: https://reviews.llvm.org/D122447 --- llvm/utils/TableGen/X86RecognizableInstr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/utils/TableGen/X86RecognizableInstr.cpp b/llvm/utils/TableGen/X86RecognizableInstr.cpp index ae01014ddd235..1ae90d888a7dc 100644 --- a/llvm/utils/TableGen/X86RecognizableInstr.cpp +++ b/llvm/utils/TableGen/X86RecognizableInstr.cpp @@ -840,8 +840,8 @@ void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const { uint8_t currentOpcode; - for (currentOpcode = opcodeToSet; currentOpcode < opcodeToSet + Count; - ++currentOpcode) + for (currentOpcode = opcodeToSet; + currentOpcode < (uint8_t)(opcodeToSet + Count); ++currentOpcode) tables.setTableFields(*opcodeType, insnContext(), currentOpcode, *filter, UID, Is32Bit, OpPrefix == 0, IgnoresVEX_L || EncodeRC,