diff --git a/src/proto/vim9compile.pro b/src/proto/vim9compile.pro index b2677c8fe504ec3f3bfc1adcb88170e2c39e259c..5486bd923624f0eb86a37a156c932b1ee9981f42 100644 --- a/src/proto/vim9compile.pro +++ b/src/proto/vim9compile.pro @@ -1,5 +1,6 @@ /* vim9compile.c */ int check_defined(char_u *p, size_t len, cctx_T *cctx); +void clear_type_list(garray_T *gap); type_T *typval2type(typval_T *tv); int check_type(type_T *expected, type_T *actual, int give_msg); char_u *skip_type(char_u *start); diff --git a/src/userfunc.c b/src/userfunc.c index 121079149aeffd019040202fd6a4e2ff1a2bec89..01c97dedd4910c9b3ff1a62a22ddc7bc3c14433b 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -1069,10 +1069,7 @@ func_clear_items(ufunc_T *fp) VIM_CLEAR(fp->uf_arg_types); VIM_CLEAR(fp->uf_def_arg_idx); VIM_CLEAR(fp->uf_va_name); - while (fp->uf_type_list.ga_len > 0) - vim_free(((type_T **)fp->uf_type_list.ga_data) - [--fp->uf_type_list.ga_len]); - ga_clear(&fp->uf_type_list); + clear_type_list(&fp->uf_type_list); #ifdef FEAT_LUA if (fp->uf_cb_free != NULL) diff --git a/src/version.c b/src/version.c index 1af0262cc77d2da990df031e8ea2e84db412b98b..7b5f8f5d07f4f32bf458bc8a69fa3853bb57e297 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1160, /**/ 1159, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index 0aae8f2138aed82f0d7b8cf8f44f8b9031294183..c0e4674de421a1c4b1d6d2de36d82a697a25a1df 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -321,6 +321,14 @@ alloc_type(garray_T *type_gap) return type; } + void +clear_type_list(garray_T *gap) +{ + while (gap->ga_len > 0) + vim_free(((type_T **)gap->ga_data)[--gap->ga_len]); + ga_clear(gap); +} + static type_T * get_list_type(type_T *member_type, garray_T *type_gap) { diff --git a/src/vim9script.c b/src/vim9script.c index 77fe6b074a10a7d0c4b7e7360b2351d5559394c7..c191113c84a05b40f7d36916dd9d4c1fa5fbb2df 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -126,7 +126,7 @@ free_imports(int sid) } ga_clear(&si->sn_imports); ga_clear(&si->sn_var_vals); - ga_clear(&si->sn_type_list); + clear_type_list(&si->sn_type_list); } /*