[PATCH] D86645: Fix an overflow issue at BackpatchWord

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 21:47:35 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGdf182eb2d5fc: Fix an overflow issue at BackpatchWord (authored by Jianzhou Zhao <jianzhouzh at google.com>).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86645

Files:
  llvm/include/llvm/Bitstream/BitstreamWriter.h


Index: llvm/include/llvm/Bitstream/BitstreamWriter.h
===================================================================
--- llvm/include/llvm/Bitstream/BitstreamWriter.h
+++ llvm/include/llvm/Bitstream/BitstreamWriter.h
@@ -103,7 +103,7 @@
   /// with the specified value.
   void BackpatchWord(uint64_t BitNo, unsigned NewWord) {
     using namespace llvm::support;
-    unsigned ByteNo = BitNo / 8;
+    uint64_t ByteNo = BitNo / 8;
     assert((!endian::readAtBitAlignment<uint32_t, little, unaligned>(
                &Out[ByteNo], BitNo & 7)) &&
            "Expected to be patching over 0-value placeholders");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86645.288181.patch
Type: text/x-patch
Size: 618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200827/9e5d3b3d/attachment.bin>


More information about the llvm-commits mailing list