[Lldb-commits] [lldb] r151439 - /lldb/trunk/include/lldb/Core/Address.h

Greg Clayton gclayton at apple.com
Fri Feb 24 23:09:11 PST 2012


Author: gclayton
Date: Sat Feb 25 01:09:11 2012
New Revision: 151439

URL: http://llvm.org/viewvc/llvm-project?rev=151439&view=rev
Log:
Avoid a throw in case we init a lldb_private::Address with an invalid SectionSP.


Modified:
    lldb/trunk/include/lldb/Core/Address.h

Modified: lldb/trunk/include/lldb/Core/Address.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=151439&r1=151438&r2=151439&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Sat Feb 25 01:09:11 2012
@@ -131,9 +131,11 @@
     ///     The offset in bytes into \a section.
     //------------------------------------------------------------------
     Address (const lldb::SectionSP &section_sp, lldb::addr_t offset) :
-        m_section_wp (section_sp),
+        m_section_wp (), // Don't init with section_sp in case section_sp is invalid (the weak_ptr will throw)
         m_offset (offset)
     {
+        if (section_sp)
+            m_section_wp = section_sp;
     }
 
     //------------------------------------------------------------------





More information about the lldb-commits mailing list