mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.0826: Vim9: crash in :defcompile
Problem: Vim9: crash in :defcompile. Solution: Restart the loop after a call to compile_def_function() caused the hash table to resize.
This commit is contained in:
@@ -3326,7 +3326,8 @@ ex_function(exarg_T *eap)
|
|||||||
void
|
void
|
||||||
ex_defcompile(exarg_T *eap UNUSED)
|
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;
|
hashitem_T *hi;
|
||||||
ufunc_T *ufunc;
|
ufunc_T *ufunc;
|
||||||
|
|
||||||
@@ -3338,7 +3339,17 @@ ex_defcompile(exarg_T *eap UNUSED)
|
|||||||
ufunc = HI2UF(hi);
|
ufunc = HI2UF(hi);
|
||||||
if (ufunc->uf_script_ctx.sc_sid == current_sctx.sc_sid
|
if (ufunc->uf_script_ctx.sc_sid == current_sctx.sc_sid
|
||||||
&& ufunc->uf_dfunc_idx == UF_TO_BE_COMPILED)
|
&& ufunc->uf_dfunc_idx == UF_TO_BE_COMPILED)
|
||||||
|
{
|
||||||
compile_def_function(ufunc, FALSE, NULL);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
826,
|
||||||
/**/
|
/**/
|
||||||
825,
|
825,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user