forked from OSchip/llvm-project
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
This commit is contained in:
parent
6d6b4d87a3
commit
d35ff4cb0d
|
@ -994,7 +994,7 @@ bool CommandObjectParsed::Execute(const char *args_string,
|
||||||
}
|
}
|
||||||
if (!handled) {
|
if (!handled) {
|
||||||
for (auto entry : llvm::enumerate(cmd_args.entries())) {
|
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(
|
cmd_args.ReplaceArgumentAtIndex(
|
||||||
entry.Index,
|
entry.Index,
|
||||||
m_interpreter.ProcessEmbeddedScriptCommands(entry.Value.c_str()));
|
m_interpreter.ProcessEmbeddedScriptCommands(entry.Value.c_str()));
|
||||||
|
|
Loading…
Reference in New Issue