From af2589ea092cead8a9b614ad411852b7e47e1066 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 12 Apr 2012 20:58:26 +0000 Subject: [PATCH] Fixed an issue that happens in LLDB versions after SBFrame switched to using a lldb::ExecutionContextRefSP where we might segfault due to using a shared pointer with NULL in it. The SBFrame object should always have a valid lldb::ExecutionContextRefSP in it. The SBFrame::Clear() method was doing the wrong thing and is now fixed. llvm-svn: 154614 --- lldb/source/API/SBFrame.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index 1b44b753ea50..42c522dfe5ab 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -86,7 +86,9 @@ SBFrame::~SBFrame() StackFrameSP SBFrame::GetFrameSP() const { - return m_opaque_sp->GetFrameSP(); + if (m_opaque_sp) + return m_opaque_sp->GetFrameSP(); + return StackFrameSP(); } void @@ -497,7 +499,7 @@ SBFrame::GetPCAddress () const void SBFrame::Clear() { - m_opaque_sp.reset(); + m_opaque_sp->Clear(); } lldb::SBValue