Skip to content

Commit 564b8a7

Browse files
committed
[lldb/Symbol] Fix null-deref in TypeList::Dump
This patch should just a crash caused by a null pointer dereferencing when dumping a type. It makes sure that the pointer is valid. rdar://97455134 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 8abf6a9 commit 564b8a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lldb/source/Symbol/TypeList.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ void TypeList::ForEach(
9292
}
9393

9494
void TypeList::Dump(Stream *s, bool show_context) {
95-
for (iterator pos = m_types.begin(), end = m_types.end(); pos != end; ++pos) {
96-
pos->get()->Dump(s, show_context);
97-
}
95+
for (iterator pos = m_types.begin(), end = m_types.end(); pos != end; ++pos)
96+
if (Type *t = pos->get())
97+
t->Dump(s, show_context);
9898
}
9999

100100
void TypeList::RemoveMismatchedTypes(const char *qualified_typename,

0 commit comments

Comments
 (0)