[PATCH] [PECOFF] Fixed a bug which caused DataDirectoryChunk to write to a wrong offset in the file buffer

Ron Ofir ron.ofir at gmail.com
Fri Jul 26 09:23:54 PDT 2013


Fixes a bug in DataDirectoryChunk::writeFile that causes it to write to a wrong a offset in the file buffer.

The bug is that the fileBuffer is advanced using _fileOffset, even though all contained AtomLayout's already have the correct offset set in the _fileOffset field.

http://llvm-reviews.chandlerc.com/D1226

Files:
  WriterPECOFF.cpp

Index: WriterPECOFF.cpp
===================================================================
--- WriterPECOFF.cpp
+++ WriterPECOFF.cpp
@@ -388,7 +388,6 @@
   }
 
   virtual void write(uint8_t *fileBuffer) {
-    fileBuffer += fileOffset();
     for (const AtomLayout *layout : _atomLayouts) {
       if (!layout)
         continue;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1226.1.patch
Type: text/x-patch
Size: 331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130726/c83b4b46/attachment.bin>


More information about the llvm-commits mailing list