[Lldb-commits] [lldb] r197862 - <rdar://problem/14822563> - Do not attempt to use a null VariableList or crashes will ensue

Enrico Granata egranata at apple.com
Sat Dec 21 00:44:28 PST 2013


Author: enrico
Date: Sat Dec 21 02:44:28 2013
New Revision: 197862

URL: http://llvm.org/viewvc/llvm-project?rev=197862&view=rev
Log:
<rdar://problem/14822563> - Do not attempt to use a null VariableList or crashes will ensue

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

Modified: lldb/trunk/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=197862&r1=197861&r2=197862&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Variable.cpp (original)
+++ lldb/trunk/source/Symbol/Variable.cpp Sat Dec 21 02:44:28 2013
@@ -832,10 +832,17 @@ PrivateAutoComplete (StackFrame *frame,
                     
                     VariableList *variable_list = frame->GetVariableList(get_file_globals);
                     
+                    if (!variable_list)
+                        break;
+                    
                     const size_t num_variables = variable_list->GetSize();
                     for (size_t i=0; i<num_variables; ++i)
                     {
                         Variable *variable = variable_list->GetVariableAtIndex(i).get();
+                        
+                        if (!variable)
+                            continue;
+                        
                         const char *variable_name = variable->GetName().AsCString();
                         if (strstr(variable_name, token.c_str()) == variable_name)
                         {





More information about the lldb-commits mailing list