Author: tkrasnukha Date: Tue Feb 26 06:50:40 2019 New Revision: 354883 URL: http://llvm.org/viewvc/llvm-project?rev=354883&view=rev Log: Fix error handling in Options::Parse
Moved `if (error.Fail())` to correct place to catch all faulty cases such as "unknown or ambiguous option" which was ignored before. Modified: lldb/trunk/source/Interpreter/Options.cpp Modified: lldb/trunk/source/Interpreter/Options.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=354883&r1=354882&r2=354883&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Options.cpp (original) +++ lldb/trunk/source/Interpreter/Options.cpp Tue Feb 26 06:50:40 2019 @@ -1436,10 +1436,11 @@ llvm::Expected<Args> Options::Parse(cons } else { error.SetErrorStringWithFormat("invalid option with value '%i'", val); } - if (error.Fail()) - return error.ToError(); } + if (error.Fail()) + return error.ToError(); + argv.erase(argv.begin(), argv.begin() + OptionParser::GetOptionIndex()); return ReconstituteArgsAfterParsing(argv, args); } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits