mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Compare all 4 bytes of the header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134427 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
af45b3d8cb
commit
82c475d057
@ -309,8 +309,9 @@ COFFObjectFile::COFFObjectFile(MemoryBuffer *Object, error_code &ec)
|
||||
if (!checkSize(Data, ec, 0x3c + 8)) return;
|
||||
HeaderStart += *reinterpret_cast<const ulittle32_t *>(base() + 0x3c);
|
||||
// Check the PE header. ("PE\0\0")
|
||||
if (StringRef(reinterpret_cast<const char *>(base() + HeaderStart), 4)
|
||||
!= "PE\0\0") {
|
||||
StringRef Actual(reinterpret_cast<const char *>(base() + HeaderStart), 4);
|
||||
StringRef Expcted("PE\0\0", 4);
|
||||
if (Actual != Expcted) {
|
||||
ec = object_error::parse_failed;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user