[all-commits] [llvm/llvm-project] f49a44: [lldb][Editline] Fix crash when navigating through...

Jordan Rupprecht via All-commits all-commits at lists.llvm.org
Wed Apr 7 10:51:36 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f49a4440d38a4123b01ded6493a02b4cbf038928
      https://github.com/llvm/llvm-project/commit/f49a4440d38a4123b01ded6493a02b4cbf038928
  Author: Jordan Rupprecht <rupprecht at google.com>
  Date:   2021-04-07 (Wed, 07 Apr 2021)

  Changed paths:
    M lldb/source/Host/common/Editline.cpp
    M lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py

  Log Message:
  -----------
  [lldb][Editline] Fix crash when navigating through empty command history.

An empty history entry can happen by entering the expression evaluator an immediately hitting enter:

```
$ lldb
(lldb) e
Enter expressions, then terminate with an empty line to evaluate:
  1:  <hit enter>
```

The next time the user enters the expression evaluator, if they hit the up arrow to load the previous expression, lldb crashes. This patch treats empty history sessions as a single expression of zero length, instead of an empty list of expressions.

Fixes http://llvm.org/PR49845.

Differential Revision: https://reviews.llvm.org/D100048




More information about the All-commits mailing list