[Lldb-commits] [lldb] fd9bc13 - [lldb] Fix a stray array access in Editline

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 4 05:26:16 PDT 2021


Author: Pavel Labath
Date: 2021-10-04T14:26:02+02:00
New Revision: fd9bc13803ee24bfa674311584126b83e059d756

URL: https://github.com/llvm/llvm-project/commit/fd9bc13803ee24bfa674311584126b83e059d756
DIFF: https://github.com/llvm/llvm-project/commit/fd9bc13803ee24bfa674311584126b83e059d756.diff

LOG: [lldb] Fix a stray array access in Editline

This manifested itself as an asan failure in TestMultilineNavigation.py.

Added: 
    

Modified: 
    lldb/source/Host/common/Editline.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp
index b55061301f4d0..6898f8452161d 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -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();


        


More information about the lldb-commits mailing list