[Lldb-commits] [lldb] r208796 - Fixed SectionLoadHistory::GetSectionLoadListForStopID() to always return a valid "SectionLoadList *".

Greg Clayton gclayton at apple.com
Wed May 14 10:25:00 PDT 2014


Author: gclayton
Date: Wed May 14 12:25:00 2014
New Revision: 208796

URL: http://llvm.org/viewvc/llvm-project?rev=208796&view=rev
Log:
Fixed SectionLoadHistory::GetSectionLoadListForStopID() to always return a valid "SectionLoadList *". 

<rdar://problem/15818525>


Modified:
    lldb/trunk/source/Target/SectionLoadHistory.cpp

Modified: lldb/trunk/source/Target/SectionLoadHistory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/SectionLoadHistory.cpp?rev=208796&r1=208795&r2=208796&view=diff
==============================================================================
--- lldb/trunk/source/Target/SectionLoadHistory.cpp (original)
+++ lldb/trunk/source/Target/SectionLoadHistory.cpp Wed May 14 12:25:00 2014
@@ -47,15 +47,7 @@ SectionLoadHistory::GetLastStopID() cons
 SectionLoadList *
 SectionLoadHistory::GetSectionLoadListForStopID (uint32_t stop_id, bool read_only)
 {
-    if (m_stop_id_to_section_load_list.empty())
-    {
-        SectionLoadListSP section_load_list_sp(new SectionLoadList());
-        if (stop_id == eStopIDNow)
-            stop_id = 0;
-        m_stop_id_to_section_load_list[stop_id] = section_load_list_sp;
-        return section_load_list_sp.get();
-    }
-    else
+    if (!m_stop_id_to_section_load_list.empty())
     {
         if (read_only)
         {
@@ -105,7 +97,11 @@ SectionLoadHistory::GetSectionLoadListFo
             return section_load_list_sp.get();
         }
     }
-    return NULL;
+    SectionLoadListSP section_load_list_sp(new SectionLoadList());
+    if (stop_id == eStopIDNow)
+        stop_id = 0;
+    m_stop_id_to_section_load_list[stop_id] = section_load_list_sp;
+    return section_load_list_sp.get();
 }
 
 SectionLoadList &





More information about the lldb-commits mailing list