diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-14 15:01:05 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-14 15:01:05 +0200 |
commit | 7ce85be63b37ab4ec791dde93a380e8a4d8a04dd (patch) | |
tree | da679ce583f4876ac399b19f7dc2e0f2d1b42886 /src/userfunc.c | |
parent | 1bce831e13c42daa3563c7f90432d9bd9b959b81 (diff) | |
download | vim-git-7ce85be63b37ab4ec791dde93a380e8a4d8a04dd.tar.gz |
patch 8.2.1207: Vim9: crash in expr test when run in the GUIv8.2.1207
Problem: Vim9: crash in expr test when run in the GUI.
Solution: Break out of loop over hashtab also when function got removed and
added.
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index 467a04601..6e49c035c 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -3444,8 +3444,8 @@ ex_function(exarg_T *eap) void ex_defcompile(exarg_T *eap UNUSED) { - long_u ht_used = func_hashtab.ht_used; - int todo = (int)ht_used; + long todo = (long)func_hashtab.ht_used; + int changed = func_hashtab.ht_changed; hashitem_T *hi; ufunc_T *ufunc; @@ -3460,12 +3460,12 @@ ex_defcompile(exarg_T *eap UNUSED) { compile_def_function(ufunc, FALSE, NULL); - if (func_hashtab.ht_used != ht_used) + if (func_hashtab.ht_changed != changed) { - // another function has been defined, need to start over + // a function has been added or removed, need to start over + todo = (long)func_hashtab.ht_used; + changed = func_hashtab.ht_changed; hi = func_hashtab.ht_array; - ht_used = func_hashtab.ht_used; - todo = (int)ht_used; --hi; } } |