comparison src/scriptfile.c @ 27045:d31bd8607975 v8.2.4051

patch 8.2.4051: compiler complains about possibly uninitialized variable Commit: https://github.com/vim/vim/commit/b06cfcf5a3b0248527fd70f9323272aa96db2f56 Author: Bram Moolenaar <Bram@vim.org> 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 10 Jan 2022 12:30:04 +0100
parents 15f40772e10a
children 140102677c12
comparison
equal deleted inserted replaced
27044:58abb7113c04 27045:d31bd8607975
272 static int 272 static int
273 get_new_scriptitem(int *error) 273 get_new_scriptitem(int *error)
274 { 274 {
275 static scid_T last_current_SID = 0; 275 static scid_T last_current_SID = 0;
276 int sid = ++last_current_SID; 276 int sid = ++last_current_SID;
277 scriptitem_T *si; 277 scriptitem_T *si = NULL;
278 278
279 if (ga_grow(&script_items, (int)(sid - script_items.ga_len)) == FAIL) 279 if (ga_grow(&script_items, (int)(sid - script_items.ga_len)) == FAIL)
280 { 280 {
281 *error = FAIL; 281 *error = FAIL;
282 return sid; 282 return sid;
303 # ifdef FEAT_PROFILE 303 # ifdef FEAT_PROFILE
304 si->sn_prof_on = FALSE; 304 si->sn_prof_on = FALSE;
305 # endif 305 # endif
306 } 306 }
307 307
308 // Used to check script variable index is still valid. 308 // "si" can't be NULL, check only to avoid a compiler warning
309 si->sn_script_seq = current_sctx.sc_seq; 309 if (si != NULL)
310 // Used to check script variable index is still valid.
311 si->sn_script_seq = current_sctx.sc_seq;
310 312
311 return sid; 313 return sid;
312 } 314 }
313 315
314 static void 316 static void