Skip to content

Commit 96f8f49

Browse files
committed
patch 8.2.1643: Vim9: :defcompile compiles dead functions
Problem: Vim9: :defcompile compiles dead functions. Solution: Skip over dead functions.
1 parent 4507f6a commit 96f8f49

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/userfunc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3583,7 +3583,8 @@ ex_function(exarg_T *eap)
35833583
}
35843584

35853585
/*
3586-
* :defcompile - compile all :def functions in the current script.
3586+
* :defcompile - compile all :def functions in the current script that need to
3587+
* be compiled. Except dead functions.
35873588
*/
35883589
void
35893590
ex_defcompile(exarg_T *eap UNUSED)
@@ -3600,7 +3601,8 @@ ex_defcompile(exarg_T *eap UNUSED)
36003601
--todo;
36013602
ufunc = HI2UF(hi);
36023603
if (ufunc->uf_script_ctx.sc_sid == current_sctx.sc_sid
3603-
&& ufunc->uf_def_status == UF_TO_BE_COMPILED)
3604+
&& ufunc->uf_def_status == UF_TO_BE_COMPILED
3605+
&& (ufunc->uf_flags & FC_DEAD) == 0)
36043606
{
36053607
compile_def_function(ufunc, FALSE, NULL);
36063608

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1643,
757759
/**/
758760
1642,
759761
/**/

0 commit comments

Comments
 (0)