diff options
Diffstat (limited to 'source/Symbol/Variable.cpp')
-rw-r--r-- | source/Symbol/Variable.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/Symbol/Variable.cpp b/source/Symbol/Variable.cpp index 7eafef1e89554..af84872a97a0e 100644 --- a/source/Symbol/Variable.cpp +++ b/source/Symbol/Variable.cpp @@ -644,11 +644,12 @@ static void PrivateAutoComplete( break; case '-': - if (partial_path[1] == '>' && !prefix_path.str().empty()) { + if (partial_path.size() > 1 && partial_path[1] == '>' && + !prefix_path.str().empty()) { switch (type_class) { case lldb::eTypeClassPointer: { CompilerType pointee_type(compiler_type.GetPointeeType()); - if (partial_path[2]) { + if (partial_path.size() > 2 && partial_path[2]) { // If there is more after the "->", then search deeper PrivateAutoComplete( frame, partial_path.substr(2), prefix_path + "->", @@ -672,7 +673,7 @@ static void PrivateAutoComplete( case lldb::eTypeClassUnion: case lldb::eTypeClassStruct: case lldb::eTypeClassClass: - if (partial_path[1]) { + if (partial_path.size() > 1 && partial_path[1]) { // If there is more after the ".", then search deeper PrivateAutoComplete(frame, partial_path.substr(1), prefix_path + ".", compiler_type, matches, @@ -760,9 +761,11 @@ size_t Variable::AutoComplete(const ExecutionContext &exe_ctx, CompilerType compiler_type; bool word_complete = false; + StringList matches; PrivateAutoComplete(exe_ctx.GetFramePtr(), request.GetCursorArgumentPrefix(), - "", compiler_type, request.GetMatches(), word_complete); + "", compiler_type, matches, word_complete); request.SetWordComplete(word_complete); + request.AddCompletions(matches); - return request.GetMatches().GetSize(); + return request.GetNumberOfMatches(); } |