Fix a thinko in CommandObjectMemoryRegion.

Don't try to read the first argument till you've checked
that there is one.

llvm-svn: 329844
This commit is contained in:
Jim Ingham 2018-04-11 19:27:03 +00:00
parent 97d18bf9e9
commit 7b57946801
1 changed files with 1 additions and 1 deletions

View File

@ -1710,8 +1710,8 @@ protected:
m_cmd_name.c_str(), m_cmd_syntax.c_str());
result.SetStatus(eReturnStatusFailed);
} else {
auto load_addr_str = command[0].ref;
if (command.GetArgumentCount() == 1) {
auto load_addr_str = command[0].ref;
load_addr = OptionArgParser::ToAddress(&m_exe_ctx, load_addr_str,
LLDB_INVALID_ADDRESS, &error);
if (error.Fail() || load_addr == LLDB_INVALID_ADDRESS) {