mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
Fix warnings: edit.c: ins_compl_next_buf(): Np dereference: FP.
Problem : Dereference of null pointer @ 3234. Diagnostic : False positive. Rationale : `wp` is local static, so maintains value between calls. First time function is called for a given flag will have `buf == curbuf`, implying `wp` initialization. Resolution : Assert variable always having been initialized.
This commit is contained in:
@@ -3231,6 +3231,7 @@ static buf_T *ins_compl_next_buf(buf_T *buf, int flag)
|
|||||||
if (flag == 'w') { /* just windows */
|
if (flag == 'w') { /* just windows */
|
||||||
if (buf == curbuf) /* first call for this flag/expansion */
|
if (buf == curbuf) /* first call for this flag/expansion */
|
||||||
wp = curwin;
|
wp = curwin;
|
||||||
|
assert(wp);
|
||||||
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
|
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
|
||||||
&& wp->w_buffer->b_scanned)
|
&& wp->w_buffer->b_scanned)
|
||||||
;
|
;
|
||||||
|
Reference in New Issue
Block a user