aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/CommandObject.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-10-06 18:57:30 +0000
committerJim Ingham <jingham@apple.com>2016-10-06 18:57:30 +0000
commitd35ff4cb0d5123646fca0434301761578fc62237 (patch)
treeba31391a0ea8eda6259fb4d53cab5461689b9f1e /lldb/source/Interpreter/CommandObject.cpp
parent6d6b4d87a39cc9fbdd6d0238c8ec0254bfa0ddd0 (diff)
downloadllvm-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.cpp2
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()));