[llvm] r185154 - llvm-symbolizer: don't leave dangling pointers after flushing LLVMSymbolizer. Add a destructor.
Alexey Samsonov
samsonov at google.com
Fri Jun 28 08:08:30 PDT 2013
Author: samsonov
Date: Fri Jun 28 10:08:29 2013
New Revision: 185154
URL: http://llvm.org/viewvc/llvm-project?rev=185154&view=rev
Log:
llvm-symbolizer: don't leave dangling pointers after flushing LLVMSymbolizer. Add a destructor.
Modified:
llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h
Modified: llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp?rev=185154&r1=185153&r2=185154&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp (original)
+++ llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp Fri Jun 28 10:08:29 2013
@@ -202,6 +202,8 @@ std::string LLVMSymbolizer::symbolizeDat
void LLVMSymbolizer::flush() {
DeleteContainerSeconds(Modules);
DeleteContainerPointers(ParsedBinariesAndObjects);
+ BinaryForPath.clear();
+ ObjectFileForArch.clear();
}
static std::string getDarwinDWARFResourceForPath(const std::string &Path) {
Modified: llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h?rev=185154&r1=185153&r2=185154&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h (original)
+++ llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h Fri Jun 28 10:08:29 2013
@@ -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).
More information about the llvm-commits
mailing list