comparison src/vim9compile.c @ 31445:85d017b25e20 v9.0.1055

patch 9.0.1055: Coverity warns for using uninitialized memory Commit: https://github.com/vim/vim/commit/f593fc891c7f6a6735b136878cc13012566ddd71 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 14 13:50:02 2022 +0000 patch 9.0.1055: Coverity warns for using uninitialized memory Problem: Coverity warns for using uninitialized memory. Solution: Clear the "lhs" field earlier.
author Bram Moolenaar <Bram@vim.org>
date Wed, 14 Dec 2022 15:00:05 +0100
parents e572ff386670
children 1bebc2093e6b
comparison
equal deleted inserted replaced
31444:4bcbc731d283 31445:85d017b25e20
2218 int incdec = FALSE; 2218 int incdec = FALSE;
2219 type_T *rhs_type = &t_any; 2219 type_T *rhs_type = &t_any;
2220 char_u *sp; 2220 char_u *sp;
2221 int is_decl = is_decl_command(cmdidx); 2221 int is_decl = is_decl_command(cmdidx);
2222 lhs_T lhs; 2222 lhs_T lhs;
2223 CLEAR_FIELD(lhs);
2223 long start_lnum = SOURCING_LNUM; 2224 long start_lnum = SOURCING_LNUM;
2224 2225
2225 int has_arg_is_set_prefix = STRNCMP(arg, "ifargisset ", 11) == 0; 2226 int has_arg_is_set_prefix = STRNCMP(arg, "ifargisset ", 11) == 0;
2226 if (has_arg_is_set_prefix) 2227 if (has_arg_is_set_prefix)
2227 { 2228 {
2241 2242
2242 // Skip over the "varname" or "[varname, varname]" to get to any "=". 2243 // Skip over the "varname" or "[varname, varname]" to get to any "=".
2243 p = skip_var_list(arg, TRUE, &var_count, &semicolon, TRUE); 2244 p = skip_var_list(arg, TRUE, &var_count, &semicolon, TRUE);
2244 if (p == NULL) 2245 if (p == NULL)
2245 return *arg == '[' ? arg : NULL; 2246 return *arg == '[' ? arg : NULL;
2246
2247 lhs.lhs_name = NULL;
2248 2247
2249 if (eap->cmdidx == CMD_increment || eap->cmdidx == CMD_decrement) 2248 if (eap->cmdidx == CMD_increment || eap->cmdidx == CMD_decrement)
2250 { 2249 {
2251 if (VIM_ISWHITE(eap->cmd[2])) 2250 if (VIM_ISWHITE(eap->cmd[2]))
2252 { 2251 {