comparison src/vim9compile.c @ 23658:c8f26523d7d7 v8.2.2371

patch 8.2.2371: Vim9: crash when using types in :for with unpack Commit: https://github.com/vim/vim/commit/036d07144efe213199b1ed8de998e6f12a056499 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 17 20:23:38 2021 +0100 patch 8.2.2371: Vim9: crash when using types in :for with unpack Problem: Vim9: crash when using types in :for with unpack. Solution: Check for skip_var_list() failing. Pass include_type to skip_var_one(). Skip type when compiling. (closes #7694)
author Bram Moolenaar <Bram@vim.org>
date Sun, 17 Jan 2021 20:30:03 +0100
parents 8dcb2255ff9a
children c761fcb89dfe
comparison
equal deleted inserted replaced
23657:71b7eeac62fc 23658:c8f26523d7d7
6882 type_T *vartype; 6882 type_T *vartype;
6883 type_T *item_type = &t_any; 6883 type_T *item_type = &t_any;
6884 int idx; 6884 int idx;
6885 6885
6886 p = skip_var_list(arg_start, TRUE, &var_count, &semicolon, FALSE); 6886 p = skip_var_list(arg_start, TRUE, &var_count, &semicolon, FALSE);
6887 if (p == NULL)
6888 return NULL;
6887 if (var_count == 0) 6889 if (var_count == 0)
6888 var_count = 1; 6890 var_count = 1;
6889 6891
6890 // consume "in" 6892 // consume "in"
6891 wp = p; 6893 wp = p;
7016 else 7018 else
7017 var_lvar->lv_type = item_type; 7019 var_lvar->lv_type = item_type;
7018 generate_STORE(cctx, ISN_STORE, var_lvar->lv_idx, NULL); 7020 generate_STORE(cctx, ISN_STORE, var_lvar->lv_idx, NULL);
7019 } 7021 }
7020 7022
7023 if (*p == ':')
7024 p = skip_type(skipwhite(p + 1), FALSE);
7021 if (*p == ',' || *p == ';') 7025 if (*p == ',' || *p == ';')
7022 ++p; 7026 ++p;
7023 arg = skipwhite(p); 7027 arg = skipwhite(p);
7024 vim_free(name); 7028 vim_free(name);
7025 } 7029 }