[PATCH] D35646: [lld] [COFF] Change the data type of a variable to uint32_t. NFC.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 14:23:10 PDT 2017


mstorsjo created this revision.

This avoids potential issues with signedness in shifts.


https://reviews.llvm.org/D35646

Files:
  COFF/Chunks.cpp


Index: COFF/Chunks.cpp
===================================================================
--- COFF/Chunks.cpp
+++ COFF/Chunks.cpp
@@ -183,7 +183,7 @@
 }
 
 static void applyArm64Ldr(uint8_t *Off, uint64_t Imm) {
-  int Size = read32le(Off) >> 30;
+  uint32_t Size = read32le(Off) >> 30;
   if ((Imm & ((1 << Size) - 1)) != 0)
     fatal("misaligned ldr/str offset");
   Imm >>= Size;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35646.107380.patch
Type: text/x-patch
Size: 385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170719/f68080b7/attachment.bin>


More information about the llvm-commits mailing list