Patch 8.2.4051

8 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 10, 2022, 8:38:16 AM1/10/22
to vim...@googlegroups.com

Patch 8.2.4051
Problem: Compiler complains about possibly uninitialized variable.
Solution: Add code to avoid a compiler warning. (John Marriott)
Files: src/scriptfile.c


*** ../vim-8.2.4050/src/scriptfile.c 2022-01-09 21:32:57.709739119 +0000
--- src/scriptfile.c 2022-01-10 11:24:52.973878296 +0000
***************
*** 274,280 ****
{
static scid_T last_current_SID = 0;
int sid = ++last_current_SID;
! scriptitem_T *si;

if (ga_grow(&script_items, (int)(sid - script_items.ga_len)) == FAIL)
{
--- 274,280 ----
{
static scid_T last_current_SID = 0;
int sid = ++last_current_SID;
! scriptitem_T *si = NULL;

if (ga_grow(&script_items, (int)(sid - script_items.ga_len)) == FAIL)
{
***************
*** 305,312 ****
# endif
}

! // Used to check script variable index is still valid.
! si->sn_script_seq = current_sctx.sc_seq;

return sid;
}
--- 305,314 ----
# endif
}

! // "si" can't be NULL, check only to avoid a compiler warning
! if (si != NULL)
! // Used to check script variable index is still valid.
! si->sn_script_seq = current_sctx.sc_seq;

return sid;
}
*** ../vim-8.2.4050/src/version.c 2022-01-09 21:32:57.713739111 +0000
--- src/version.c 2022-01-09 21:35:53.713433768 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4051,
/**/

--
There is a fine line between courage and foolishness.
Unfortunately, it's not a fence.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages