[lldb] Fix a stray array access in Editline
authorPavel Labath <pavel@labath.sk>
Mon, 4 Oct 2021 12:23:44 +0000 (14:23 +0200)
committerPavel Labath <pavel@labath.sk>
Mon, 4 Oct 2021 12:26:02 +0000 (14:26 +0200)
This manifested itself as an asan failure in TestMultilineNavigation.py.

lldb/source/Host/common/Editline.cpp

index b550613..6898f84 100644 (file)
@@ -1560,7 +1560,7 @@ bool Editline::GetLines(int first_line_number, StringList &lines,
   if (!interrupted) {
     // Save the completed entry in history before returning. Don't save empty
     // input as that just clutters the command history.
-    if (m_input_lines.size() > 1 || !m_input_lines.front().empty())
+    if (!m_input_lines.empty())
       m_history_sp->Enter(CombineLines(m_input_lines).c_str());
 
     lines = GetInputAsStringList();