# HG changeset patch # User Bram Moolenaar # Date 1641814204 -3600 # Node ID d31bd86079751c6ca9fb65e456dfe6762606b5e9 # Parent 58abb7113c04f48fa521f6e1636c0fac3baecd63 patch 8.2.4051: compiler complains about possibly uninitialized variable Commit: https://github.com/vim/vim/commit/b06cfcf5a3b0248527fd70f9323272aa96db2f56 Author: Bram Moolenaar Date: Mon Jan 10 11:26:33 2022 +0000 patch 8.2.4051: compiler complains about possibly uninitialized variable Problem: Compiler complains about possibly uninitialized variable. Solution: Add code to avoid a compiler warning. (John Marriott) diff --git a/src/scriptfile.c b/src/scriptfile.c --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -274,7 +274,7 @@ get_new_scriptitem(int *error) { static scid_T last_current_SID = 0; int sid = ++last_current_SID; - scriptitem_T *si; + scriptitem_T *si = NULL; if (ga_grow(&script_items, (int)(sid - script_items.ga_len)) == FAIL) { @@ -305,8 +305,10 @@ get_new_scriptitem(int *error) # endif } - // Used to check script variable index is still valid. - si->sn_script_seq = current_sctx.sc_seq; + // "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; } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4051, +/**/ 4050, /**/ 4049,