Force the initialization of the m_type ivar in
authorJason Molenda <jmolenda@apple.com>
Thu, 8 Sep 2016 02:26:58 +0000 (02:26 +0000)
committerJason Molenda <jmolenda@apple.com>
Thu, 8 Sep 2016 02:26:58 +0000 (02:26 +0000)
Function::GetStartLineSourceInfo before we try to
return the start line information about a function;
this function requires it to have been initialized.

llvm-svn: 280902

lldb/source/Symbol/Function.cpp

index 06f8ad5..9634616 100644 (file)
@@ -163,6 +163,9 @@ void Function::GetStartLineSourceInfo(FileSpec &source_file,
   if (m_comp_unit == nullptr)
     return;
 
+  // Initialize m_type if it hasn't been initialized already
+  GetType();
+
   if (m_type != nullptr && m_type->GetDeclaration().GetLine() != 0) {
     source_file = m_type->GetDeclaration().GetFile();
     line_no = m_type->GetDeclaration().GetLine();