[all-commits] [llvm/llvm-project] fb10b0: [lldb] Prevent crash when completing ambiguous sub...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Mon Jul 10 14:50:55 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb10b01cca85306c8a94826e31e8a4dfb8aff502
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M lldb/source/Commands/CommandObjectMultiword.cpp
    M lldb/test/API/functionalities/completion/TestCompletion.py

  Log Message:
  [lldb] Prevent crash when completing ambiguous subcommands

Fix a crash when trying to complete an ambiguous subcommand. Take `set s
tar` for example: for the subcommand `s` there's ambiguity between set
and show. Pressing TAB after this input currently crashes LLDB. The
problem is that we're trying to complete `tar` but give up at `s`
because of the ambiguity. LLDB doesn't expect the completed string to be
shorter than the current string and crashes when trying to eliminate the
common prefix.


Differential revision: https://reviews.llvm.org/D154643

More information about the All-commits mailing list