[llvm-commits] [llvm] r134439 - /llvm/trunk/lib/Object/COFFObjectFile.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Jul 5 13:28:00 PDT 2011
Author: d0k
Date: Tue Jul 5 15:28:00 2011
New Revision: 134439
URL: http://llvm.org/viewvc/llvm-project?rev=134439&view=rev
Log:
Use memcmp.
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=134439&r1=134438&r2=134439&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Tue Jul 5 15:28:00 2011
@@ -309,9 +309,7 @@
if (!checkSize(Data, ec, 0x3c + 8)) return;
HeaderStart += *reinterpret_cast<const ulittle32_t *>(base() + 0x3c);
// Check the PE header. ("PE\0\0")
- StringRef Actual(reinterpret_cast<const char *>(base() + HeaderStart), 4);
- StringRef Expected("PE\0\0", 4);
- if (Actual != Expected) {
+ if (std::memcmp(base() + HeaderStart, "PE\0\0", 4) != 0) {
ec = object_error::parse_failed;
return;
}
More information about the llvm-commits
mailing list