From ede0585ec2d78091eed23074cb7d53668ff194c6 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 20 Jul 2010 22:54:09 +0000 Subject: Fixing a crashing bug in multiword commands from William Lynch. llvm-svn: 108958 --- lldb/source/Commands/CommandObjectMultiword.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp') diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index 9e02d9e..ed118f7 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); } -- cgit v1.1