[Lldb-commits] [lldb] r220026 - Break out of the command word parsing loop if we hit

Jason Molenda jmolenda at apple.com
Thu Oct 16 19:10:34 PDT 2014


Author: jmolenda
Date: Thu Oct 16 21:10:33 2014
New Revision: 220026

URL: http://llvm.org/viewvc/llvm-project?rev=220026&view=rev
Log:
Break out of the command word parsing loop if we hit
an invalid combination of words; don't accidentally
continue trying to parse the command line.
clang static analysis fixit.

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

Modified: lldb/trunk/source/Commands/CommandObjectSyntax.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSyntax.cpp?rev=220026&r1=220025&r2=220026&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSyntax.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSyntax.cpp Thu Oct 16 21:10:33 2014
@@ -69,12 +69,18 @@ CommandObjectSyntax::DoExecute (Args& co
         {
             std::string sub_command = command.GetArgumentAtIndex (i);
             if (!cmd_obj->IsMultiwordObject())
+            {
                 all_okay = false;
+                break;
+            }
             else
             {
                 cmd_obj = cmd_obj->GetSubcommandObject(sub_command.c_str());
                 if (!cmd_obj)
+                {
                     all_okay = false;
+                    break;
+                }
             }
         }
         





More information about the lldb-commits mailing list