[PATCH] D122447: Prevent comparison with wider type in loop condition

Aakanksha Patil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 01:53:56 PDT 2022


aakanksha555 updated this revision to Diff 418156.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122447/new/

https://reviews.llvm.org/D122447

Files:
  llvm/utils/TableGen/X86RecognizableInstr.cpp


Index: llvm/utils/TableGen/X86RecognizableInstr.cpp
===================================================================
--- llvm/utils/TableGen/X86RecognizableInstr.cpp
+++ llvm/utils/TableGen/X86RecognizableInstr.cpp
@@ -840,8 +840,8 @@
 
     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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122447.418156.patch
Type: text/x-patch
Size: 684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220325/ae01471a/attachment.bin>


More information about the llvm-commits mailing list