diff options
author | Greg Clayton <gclayton@apple.com> | 2010-07-20 22:54:09 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-07-20 22:54:09 +0000 |
commit | ede0585ec2d78091eed23074cb7d53668ff194c6 (patch) | |
tree | 2f6b803618f051e74491cb3142f78c86173455dc /lldb/source/Commands/CommandObjectMultiword.cpp | |
parent | 471b31ce625e61664236c718f5f2a76135644514 (diff) | |
download | bcm5719-llvm-ede0585ec2d78091eed23074cb7d53668ff194c6.tar.gz bcm5719-llvm-ede0585ec2d78091eed23074cb7d53668ff194c6.zip |
Fixing a crashing bug in multiword commands from William Lynch.
llvm-svn: 108958
Diffstat (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectMultiword.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index 9e02d9eec32..ed118f769e1 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -290,13 +290,12 @@ CommandObjectMultiword::HandleCompletion const char * CommandObjectMultiword::GetRepeatCommand (Args ¤t_command_args, uint32_t index) { - if (current_command_args.GetArgumentCount() == 0) - return NULL; index++; + if (current_command_args.GetArgumentCount() <= index) + return NULL; CommandObject *sub_command_object = GetSubcommandObject (current_command_args.GetArgumentAtIndex(index)); if (sub_command_object == NULL) return NULL; - else return sub_command_object->GetRepeatCommand(current_command_args, index); } |