[Lldb-commits] [lldb] r108958 - /lldb/trunk/source/Commands/CommandObjectMultiword.cpp

Greg Clayton gclayton at apple.com
Tue Jul 20 15:54:09 PDT 2010


Author: gclayton
Date: Tue Jul 20 17:54:09 2010
New Revision: 108958

URL: http://llvm.org/viewvc/llvm-project?rev=108958&view=rev
Log:
Fixing a crashing bug in multiword commands from William Lynch.


Modified:
    lldb/trunk/source/Commands/CommandObjectMultiword.cpp

Modified: lldb/trunk/source/Commands/CommandObjectMultiword.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMultiword.cpp?rev=108958&r1=108957&r2=108958&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMultiword.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMultiword.cpp Tue Jul 20 17:54:09 2010
@@ -290,13 +290,12 @@
 const char *
 CommandObjectMultiword::GetRepeatCommand (Args &current_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);
 }
 





More information about the lldb-commits mailing list