mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
screen: Silence NULL dereference false positive
Based on the loop condition when shl_flag is true cur != NULL.
This commit is contained in:
parent
7cf4b0ac06
commit
48ad8e0ff1
@ -2579,13 +2579,14 @@ win_line (
|
|||||||
* Do this for both search_hl and the match list.
|
* Do this for both search_hl and the match list.
|
||||||
*/
|
*/
|
||||||
cur = wp->w_match_head;
|
cur = wp->w_match_head;
|
||||||
shl_flag = FALSE;
|
shl_flag = false;
|
||||||
while (cur != NULL || shl_flag == FALSE) {
|
while (cur != NULL || !shl_flag) {
|
||||||
if (shl_flag == FALSE) {
|
if (!shl_flag) {
|
||||||
shl = &search_hl;
|
shl = &search_hl;
|
||||||
shl_flag = TRUE;
|
shl_flag = true;
|
||||||
} else
|
} else {
|
||||||
shl = &cur->hl;
|
shl = &cur->hl; // -V595
|
||||||
|
}
|
||||||
shl->startcol = MAXCOL;
|
shl->startcol = MAXCOL;
|
||||||
shl->endcol = MAXCOL;
|
shl->endcol = MAXCOL;
|
||||||
shl->attr_cur = 0;
|
shl->attr_cur = 0;
|
||||||
@ -5536,13 +5537,14 @@ static void prepare_search_hl(win_T *wp, linenr_T lnum)
|
|||||||
* Do this both for search_hl and the match list.
|
* Do this both for search_hl and the match list.
|
||||||
*/
|
*/
|
||||||
cur = wp->w_match_head;
|
cur = wp->w_match_head;
|
||||||
shl_flag = FALSE;
|
shl_flag = false;
|
||||||
while (cur != NULL || shl_flag == FALSE) {
|
while (cur != NULL || shl_flag == false) {
|
||||||
if (shl_flag == FALSE) {
|
if (shl_flag == false) {
|
||||||
shl = &search_hl;
|
shl = &search_hl;
|
||||||
shl_flag = TRUE;
|
shl_flag = true;
|
||||||
} else
|
} else {
|
||||||
shl = &cur->hl;
|
shl = &cur->hl; // -V595
|
||||||
|
}
|
||||||
if (shl->rm.regprog != NULL
|
if (shl->rm.regprog != NULL
|
||||||
&& shl->lnum == 0
|
&& shl->lnum == 0
|
||||||
&& re_multiline(shl->rm.regprog)) {
|
&& re_multiline(shl->rm.regprog)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user