From 6ff7240a5c484af6e42e2ba6a6d7e03ddf844922 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 30 Nov 2005 05:21:10 +0000 Subject: Fix a problem with llvm-ranlib that (on some platforms) caused the archive file to become corrupted due to interactions between mmap'd memory segments and file descriptors closing. The problem is completely avoiding by using a third temporary file. Patch provided by Evan Jones git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24527 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Bytecode/Archive.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/llvm/Bytecode/Archive.h') diff --git a/include/llvm/Bytecode/Archive.h b/include/llvm/Bytecode/Archive.h index b81ec3cb0d..aa94ca2e91 100644 --- a/include/llvm/Bytecode/Archive.h +++ b/include/llvm/Bytecode/Archive.h @@ -489,6 +489,9 @@ class Archive { bool fillHeader(const ArchiveMember&mbr, ArchiveMemberHeader& hdr,int sz, bool TruncateNames) const; + /// @brief Frees all the members and unmaps the archive file. + void Archive::cleanUpMemory(); + /// This type is used to keep track of bytecode modules loaded from the /// symbol table. It maps the file offset to a pair that consists of the /// associated ArchiveMember and the ModuleProvider. -- cgit v1.2.3