summaryrefslogtreecommitdiffstats
path: root/llvm/lib/BinaryFormat/Magic.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-12-01 00:22:39 +0000
committerZachary Turner <zturner@google.com>2018-12-01 00:22:39 +0000
commitb07298eeddd95c294ee877daa64f5f3ecf92a78e (patch)
tree8dc37e63c5feb8ff938e4ac6c9451690871a3ad7 /llvm/lib/BinaryFormat/Magic.cpp
parentba968c0d1d849d0598ebb2dbcdbace97f0709a29 (diff)
downloadbcm5719-llvm-b07298eeddd95c294ee877daa64f5f3ecf92a78e.tar.gz
bcm5719-llvm-b07298eeddd95c294ee877daa64f5f3ecf92a78e.zip
Use RequireNullTerminator=false in identify_magic.
identify_magic does not need the file to be null terminated. Passing true here causes the file reading code to decide not to use mmap in some rare cases (which happen to be true 100% of the time in PDB files) which can lead to very large files failing to load. Since it was probably just an accident that we were passing true here (since it is the default function parameter), this should be strictly an improvement. llvm-svn: 348059
Diffstat (limited to 'llvm/lib/BinaryFormat/Magic.cpp')
-rw-r--r--llvm/lib/BinaryFormat/Magic.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/BinaryFormat/Magic.cpp b/llvm/lib/BinaryFormat/Magic.cpp
index 5a339583fca..78efa6ec87b 100644
--- a/llvm/lib/BinaryFormat/Magic.cpp
+++ b/llvm/lib/BinaryFormat/Magic.cpp
@@ -206,7 +206,7 @@ file_magic llvm::identify_magic(StringRef Magic) {
}
std::error_code llvm::identify_magic(const Twine &Path, file_magic &Result) {
- auto FileOrError = MemoryBuffer::getFile(Path);
+ auto FileOrError = MemoryBuffer::getFile(Path, -1LL, false);
if (!FileOrError)
return FileOrError.getError();
OpenPOWER on IntegriCloud