[llvm] r278429 - Re-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 11 15:02:45 PDT 2016
Author: ruiu
Date: Thu Aug 11 17:02:44 2016
New Revision: 278429
URL: http://llvm.org/viewvc/llvm-project?rev=278429&view=rev
Log:
Re-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.
Modified:
llvm/trunk/lib/Object/COFFObjectFile.cpp
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=278429&r1=278428&r2=278429&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Thu Aug 11 17:02:44 2016
@@ -718,9 +718,11 @@ COFFObjectFile::COFFObjectFile(MemoryBuf
}
if ((EC = getObject(DataDirectory, Data, DataDirAddr, DataDirSize)))
return;
- CurPtr += COFFHeader->SizeOfOptionalHeader;
}
+ if (COFFHeader)
+ CurPtr += COFFHeader->SizeOfOptionalHeader;
+
if ((EC = getObject(SectionTable, Data, base() + CurPtr,
(uint64_t)getNumberOfSections() * sizeof(coff_section))))
return;
More information about the llvm-commits
mailing list