1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

llvm-symbolizer: don't leave dangling pointers after flushing LLVMSymbolizer. Add a destructor.

llvm-svn: 185154
This commit is contained in:
Alexey Samsonov 2013-06-28 15:08:29 +00:00
parent 225b8ce2e7
commit 8a74ed4a71
2 changed files with 5 additions and 0 deletions

View File

@ -202,6 +202,8 @@ std::string LLVMSymbolizer::symbolizeData(const std::string &ModuleName,
void LLVMSymbolizer::flush() {
DeleteContainerSeconds(Modules);
DeleteContainerPointers(ParsedBinariesAndObjects);
BinaryForPath.clear();
ObjectFileForArch.clear();
}
static std::string getDarwinDWARFResourceForPath(const std::string &Path) {

View File

@ -48,6 +48,9 @@ public:
};
LLVMSymbolizer(const Options &Opts = Options()) : Opts(Opts) {}
~LLVMSymbolizer() {
flush();
}
// Returns the result of symbolization for module name/offset as
// a string (possibly containing newlines).