[lld] r363397 - lld/coff: slightly simplify ImportFile::parse()
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 14 07:03:09 PDT 2019
Author: nico
Date: Fri Jun 14 07:03:08 2019
New Revision: 363397
URL: http://llvm.org/viewvc/llvm-project?rev=363397&view=rev
Log:
lld/coff: slightly simplify ImportFile::parse()
Modified:
lld/trunk/COFF/InputFiles.cpp
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=363397&r1=363396&r2=363397&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Fri Jun 14 07:03:08 2019
@@ -728,11 +728,10 @@ StringRef ltrim1(StringRef S, const char
void ImportFile::parse() {
const char *Buf = MB.getBufferStart();
- const char *End = MB.getBufferEnd();
const auto *Hdr = reinterpret_cast<const coff_import_header *>(Buf);
// Check if the total size is valid.
- if ((size_t)(End - Buf) != (sizeof(*Hdr) + Hdr->SizeOfData))
+ if (MB.getBufferSize() != sizeof(*Hdr) + Hdr->SizeOfData)
fatal("broken import library");
// Read names and create an __imp_ symbol.
More information about the llvm-commits
mailing list