From d35ff4cb0d5123646fca0434301761578fc62237 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Thu, 6 Oct 2016 18:57:30 +0000 Subject: StringRef::front asserts on empty strings, causing "break modify -c ''" to assert. Added a check for empty at the point where we were going to crash. llvm-svn: 283479 --- lldb/source/Interpreter/CommandObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Interpreter/CommandObject.cpp') diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index fc1d70bd11c..b04c6f754b5 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -994,7 +994,7 @@ bool CommandObjectParsed::Execute(const char *args_string, } if (!handled) { for (auto entry : llvm::enumerate(cmd_args.entries())) { - if (entry.Value.ref.front() == '`') { + if (!entry.Value.ref.empty() && entry.Value.ref.front() == '`') { cmd_args.ReplaceArgumentAtIndex( entry.Index, m_interpreter.ProcessEmbeddedScriptCommands(entry.Value.c_str())); -- cgit v1.2.3