mirror of
https://github.com/neovim/neovim.git
synced 2025-09-22 11:18:19 +00:00
clang/"Argument with 'nonnull' attribute passed null" #10739
Problem: In screen.c grid_char_needs_redraw clang warns that grid->chars could be NULL Solution: Suggested by bfredl. Add explicit check grid->chars != NULL in grid_put_linebuf similar to grid_puts_len
This commit is contained in:

committed by
Justin M. Keyes

parent
c190415dc2
commit
e5d388f23a
@@ -4374,6 +4374,12 @@ static void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int endcol,
|
|||||||
|
|
||||||
screen_adjust_grid(&grid, &row, &coloff);
|
screen_adjust_grid(&grid, &row, &coloff);
|
||||||
|
|
||||||
|
// Safety check. Avoids clang warnings down the call stack.
|
||||||
|
if (grid->chars == NULL || row >= grid->Rows || col >= grid->Columns) {
|
||||||
|
DLOG("invalid state, skipped");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
off_from = 0;
|
off_from = 0;
|
||||||
off_to = grid->line_offset[row] + coloff;
|
off_to = grid->line_offset[row] + coloff;
|
||||||
max_off_from = linebuf_size;
|
max_off_from = linebuf_size;
|
||||||
|
Reference in New Issue
Block a user