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 <medismail.bennani@gmail.com>
}
void TypeList::Dump(Stream *s, bool show_context) {
- for (iterator pos = m_types.begin(), end = m_types.end(); pos != end; ++pos) {
- pos->get()->Dump(s, show_context);
- }
+ for (iterator pos = m_types.begin(), end = m_types.end(); pos != end; ++pos)
+ if (Type *t = pos->get())
+ t->Dump(s, show_context);
}
void TypeList::RemoveMismatchedTypes(llvm::StringRef qualified_typename,