Fix FileArchive member MemoryBuffer early destruction
When FileArchive loads a member, it instantiates a temporary MemoryBuffer which points to the member range of the archive file. The problem is that the object file parsers call getBufferIndentifer() on that temporary MemoryBuffer and store that StringRef as the _path data member for that lld::File. When FileArchive::instantiateMember() goes out of scope the MemoryBuffer is deleted and the File::._path becomes a dangling reference. The fix adds a vector<> to FileArchive to own the instantiated MemoryBuffers. In addition it fixes member's path to be the standard format (e.g. "/path/libfoo.a(foo.o)") instead of just the leaf name. llvm-svn: 221544
Loading
Please sign in to comment