[Lldb-commits] [PATCH] D131615: [LLDB][NFC] Reliability fixes for IOHandlerCursesGUI

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 11 11:09:59 PDT 2022


clayborg added inline comments.


================
Comment at: lldb/source/Core/IOHandlerCursesGUI.cpp:391-394
+  uint32_t GetMaxX() const { return getmaxx(m_window); }
+  uint32_t GetMaxY() const { return getmaxy(m_window); }
+  uint32_t GetWidth() const { return GetMaxX(); }
+  uint32_t GetHeight() const { return GetMaxY(); }
----------------
fixathon wrote:
> fixathon wrote:
> > clayborg wrote:
> > > the underlying curses functions return "int". Were there places where people were comparing them to unsigned?
> > A function HorizontalLine() at line 2582 requires non-negative input. Good point about the underlying function possibly returning a negative still.
> I took another look, and I am not sure what the complaint is. Both the HorizontalLine() and its underlying call to ::whline take input typed as "signed int". Perhaps ::whline is unable to handle negative input?
> 
>   void HorizontalLine(int n, chtype h_char = ACS_HLINE) {
>     ::whline(m_window, h_char, n);
>   }
Not sure either. I don't want to change these as they should return "int" like the original API.


================
Comment at: lldb/source/Core/IOHandlerCursesGUI.cpp:2582
     surface.MoveCursor(0, 1);
     surface.HorizontalLine(surface.GetWidth());
   }
----------------
fixathon wrote:
> Here we have HorizontalLine() function that requires non-negative input
But surface.HorizontalLine(...) function takes an "int", and now we are passing it a uint32_t. If this function requires a >= 0 value, it should do the check internally


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131615/new/

https://reviews.llvm.org/D131615



More information about the lldb-commits mailing list