[Lldb-commits] [lldb] r280902 - Force the initialization of the m_type ivar in

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 7 19:27:00 PDT 2016


Author: jmolenda
Date: Wed Sep  7 21:26:58 2016
New Revision: 280902

URL: http://llvm.org/viewvc/llvm-project?rev=280902&view=rev
Log:
Force the initialization of the m_type ivar in
Function::GetStartLineSourceInfo before we try to
return the start line information about a function;
this function requires it to have been initialized.

Modified:
    lldb/trunk/source/Symbol/Function.cpp

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=280902&r1=280901&r2=280902&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Wed Sep  7 21:26:58 2016
@@ -163,6 +163,9 @@ void Function::GetStartLineSourceInfo(Fi
   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();




More information about the lldb-commits mailing list