forked from OSchip/llvm-project
Addresses an unsigned underflow situation that can occur when dumping an empty command history.
One example where this occurs in practice is starting the Swift REPL and typing ":command history" since REPL commands aren't stored in the LLDB command prompt history. llvm-svn: 256888
This commit is contained in:
parent
03f483353c
commit
0167e064f3
|
@ -130,9 +130,9 @@ CommandHistory::Dump (Stream& stream,
|
|||
size_t stop_idx) const
|
||||
{
|
||||
Mutex::Locker locker(m_mutex);
|
||||
stop_idx = std::min(stop_idx, m_history.size() - 1);
|
||||
stop_idx = std::min(stop_idx + 1, m_history.size());
|
||||
for (size_t counter = start_idx;
|
||||
counter <= stop_idx;
|
||||
counter < stop_idx;
|
||||
counter++)
|
||||
{
|
||||
const std::string hist_item = m_history[counter];
|
||||
|
|
Loading…
Reference in New Issue