# HG changeset patch # User Bram Moolenaar # Date 1599664504 -7200 # Node ID ec0a5ae32d5ed352fa6aa91b0a73b518eebc4e05 # Parent cc2879441e5d44307beb65e911caf26c09a5bea9 patch 8.2.1643: Vim9: :defcompile compiles dead functions Commit: https://github.com/vim/vim/commit/96f8f499ce51ea791d9b044c266f84380fa54848 Author: Bram Moolenaar Date: Wed Sep 9 17:08:51 2020 +0200 patch 8.2.1643: Vim9: :defcompile compiles dead functions Problem: Vim9: :defcompile compiles dead functions. Solution: Skip over dead functions. diff --git a/src/userfunc.c b/src/userfunc.c --- a/src/userfunc.c +++ b/src/userfunc.c @@ -3583,7 +3583,8 @@ ex_function(exarg_T *eap) } /* - * :defcompile - compile all :def functions in the current script. + * :defcompile - compile all :def functions in the current script that need to + * be compiled. Except dead functions. */ void ex_defcompile(exarg_T *eap UNUSED) @@ -3600,7 +3601,8 @@ ex_defcompile(exarg_T *eap UNUSED) --todo; ufunc = HI2UF(hi); if (ufunc->uf_script_ctx.sc_sid == current_sctx.sc_sid - && ufunc->uf_def_status == UF_TO_BE_COMPILED) + && ufunc->uf_def_status == UF_TO_BE_COMPILED + && (ufunc->uf_flags & FC_DEAD) == 0) { compile_def_function(ufunc, FALSE, NULL); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1643, +/**/ 1642, /**/ 1641,