diff options
author | Jim Ingham <jingham@apple.com> | 2016-10-06 18:57:30 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2016-10-06 18:57:30 +0000 |
commit | d35ff4cb0d5123646fca0434301761578fc62237 (patch) | |
tree | ba31391a0ea8eda6259fb4d53cab5461689b9f1e /lldb/source/Interpreter/CommandObject.cpp | |
parent | 6d6b4d87a39cc9fbdd6d0238c8ec0254bfa0ddd0 (diff) | |
download | llvm-d35ff4cb0d5123646fca0434301761578fc62237.zip llvm-d35ff4cb0d5123646fca0434301761578fc62237.tar.gz llvm-d35ff4cb0d5123646fca0434301761578fc62237.tar.bz2 |
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.
<rdar://problem/28654032>
llvm-svn: 283479
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index fc1d70b..b04c6f7 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())); |