Patch 8.2.0826
Problem: Vim9: crash in :defcompile.
Solution: Restart the loop after a call to compile_def_function() caused the
hash table to resize.
Files: src/userfunc.c
*** ../vim-8.2.0825/src/userfunc.c 2020-05-25 23:29:24.572124376 +0200
--- src/userfunc.c 2020-05-26 11:05:31.072892705 +0200
***************
*** 3326,3332 ****
void
ex_defcompile(exarg_T *eap UNUSED)
{
! int todo = (int)func_hashtab.ht_used;
hashitem_T *hi;
ufunc_T *ufunc;
--- 3326,3333 ----
void
ex_defcompile(exarg_T *eap UNUSED)
{
! long_u ht_used = func_hashtab.ht_used;
! int todo = (int)ht_used;
hashitem_T *hi;
ufunc_T *ufunc;
***************
*** 3338,3344 ****
--- 3339,3355 ----
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;
+ }
+ }
}
}
}
*** ../vim-8.2.0825/src/version.c 2020-05-25 23:29:24.572124376 +0200
--- src/version.c 2020-05-26 11:07:59.672488579 +0200
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 826,
/**/
--
hundred-and-one symptoms of being an internet addict:
179. You wonder why your household garbage can doesn't have an
"empty recycle bin" button.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202005260910.04Q9A6mE530957%40masaka.moolenaar.net.