diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-05-26 11:08:28 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-05-26 11:08:28 +0200 |
commit | ebc3de634f4c2893f34e41b4f8da1d59212e59ea (patch) | |
tree | 42c5f960018d8e4922b12c62b56b4f96bf0c8467 /src | |
parent | a14e6975478adeddcc2161edc1ec611016aa89f3 (diff) | |
download | vim-git-ebc3de634f4c2893f34e41b4f8da1d59212e59ea.tar.gz |
patch 8.2.0826: Vim9: crash in :defcompilev8.2.0826
Problem: Vim9: crash in :defcompile.
Solution: Restart the loop after a call to compile_def_function() caused the
hash table to resize.
Diffstat (limited to 'src')
-rw-r--r-- | src/userfunc.c | 13 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index c50a871c2..4a12c1984 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -3326,7 +3326,8 @@ ex_function(exarg_T *eap) void ex_defcompile(exarg_T *eap UNUSED) { - int todo = (int)func_hashtab.ht_used; + long_u ht_used = func_hashtab.ht_used; + int todo = (int)ht_used; hashitem_T *hi; ufunc_T *ufunc; @@ -3338,7 +3339,17 @@ ex_defcompile(exarg_T *eap UNUSED) ufunc = HI2UF(hi); if (ufunc->uf_script_ctx.sc_sid == current_sctx.sc_sid && ufunc->uf_dfunc_idx == UF_TO_BE_COMPILED) + { compile_def_function(ufunc, FALSE, NULL); + + if (func_hashtab.ht_used != ht_used) + { + // another function has been defined, need to start over + hi = func_hashtab.ht_array; + ht_used = func_hashtab.ht_used; + todo = (int)ht_used; + } + } } } } diff --git a/src/version.c b/src/version.c index 5ccbfad01..173087551 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 826, +/**/ 825, /**/ 824, |