[all-commits] [llvm/llvm-project] 698e21: [LLDB][GUI] Fix text field incorrect key handling

Omar Emara via All-commits all-commits at lists.llvm.org
Wed Aug 18 15:06:42 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 698e2106362add2bd3aca6f8ffebe9dd90a50529
      https://github.com/llvm/llvm-project/commit/698e2106362add2bd3aca6f8ffebe9dd90a50529
  Author: Omar Emara <mail at OmarEmara.dev>
  Date:   2021-08-18 (Wed, 18 Aug 2021)

  Changed paths:
    M lldb/source/Core/IOHandlerCursesGUI.cpp

  Log Message:
  -----------
  [LLDB][GUI] Fix text field incorrect key handling

The isprint libc function was used to determine if the key code
represents a printable character. The problem is that the specification
leaves the behavior undefined if the key is not representable as an
unsigned char, which is the case for many ncurses keys. This patch adds
and explicit check for this undefined behavior and make it consistent.

The llvm::isPrint function didn't work correctly for some reason, most
likely because it takes a char instead of an int, which I guess makes it
unsuitable for checking ncurses key codes.

Reviewed By: clayborg

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




More information about the All-commits mailing list