<rdar://problem/14822563> - Do not attempt to use a null VariableList or crashes will ensue

llvm-svn: 197862
This commit is contained in:
Enrico Granata 2013-12-21 08:44:28 +00:00
parent 0c0f9dcd91
commit 16f35ea9bb
1 changed files with 7 additions and 0 deletions

View File

@ -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)
{