diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-06-28 15:08:29 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-06-28 15:08:29 +0000 |
commit | 0ed872cdd1e5d7d60983854ea49aff13aa3280c1 (patch) | |
tree | aca0b81e9c2deafa1fad4d59587b58de3577a670 /tools | |
parent | 8c6e3248e90605f0ff7249a9727fe46e79297b25 (diff) | |
download | external_llvm-0ed872cdd1e5d7d60983854ea49aff13aa3280c1.zip external_llvm-0ed872cdd1e5d7d60983854ea49aff13aa3280c1.tar.gz external_llvm-0ed872cdd1e5d7d60983854ea49aff13aa3280c1.tar.bz2 |
llvm-symbolizer: don't leave dangling pointers after flushing LLVMSymbolizer. Add a destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-symbolizer/LLVMSymbolize.cpp | 2 | ||||
-rw-r--r-- | tools/llvm-symbolizer/LLVMSymbolize.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tools/llvm-symbolizer/LLVMSymbolize.cpp b/tools/llvm-symbolizer/LLVMSymbolize.cpp index 5956416..57f34c2 100644 --- a/tools/llvm-symbolizer/LLVMSymbolize.cpp +++ b/tools/llvm-symbolizer/LLVMSymbolize.cpp @@ -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) { diff --git a/tools/llvm-symbolizer/LLVMSymbolize.h b/tools/llvm-symbolizer/LLVMSymbolize.h index d1f2285..03c765c 100644 --- a/tools/llvm-symbolizer/LLVMSymbolize.h +++ b/tools/llvm-symbolizer/LLVMSymbolize.h @@ -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). |