Fixed SectionLoadHistory::GetSectionLoadListForStopID() to always return a valid "SectionLoadList *".

<rdar://problem/15818525>

llvm-svn: 208796
This commit is contained in:
Greg Clayton 2014-05-14 17:25:00 +00:00
parent 63488f0e4e
commit 24feaf70aa
1 changed files with 6 additions and 10 deletions

View File

@ -47,15 +47,7 @@ SectionLoadHistory::GetLastStopID() const
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::GetSectionLoadListForStopID (uint32_t stop_id, bool read_onl
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 &