[llvm-commits] [llvm] r134427 - /llvm/trunk/lib/Object/COFFObjectFile.cpp
Rafael Espindola
rafael.espindola at gmail.com
Tue Jul 5 11:41:47 PDT 2011
Author: rafael
Date: Tue Jul 5 13:41:47 2011
New Revision: 134427
URL: http://llvm.org/viewvc/llvm-project?rev=134427&view=rev
Log:
Compare all 4 bytes of the header.
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=134427&r1=134426&r2=134427&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Tue Jul 5 13:41:47 2011
@@ -309,8 +309,9 @@
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;
}
More information about the llvm-commits
mailing list