]> granicus.if.org Git - vim/commitdiff
patch 8.2.1643: Vim9: :defcompile compiles dead functions v8.2.1643
authorBram Moolenaar <Bram@vim.org>
Wed, 9 Sep 2020 15:08:51 +0000 (17:08 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 9 Sep 2020 15:08:51 +0000 (17:08 +0200)
Problem:    Vim9: :defcompile compiles dead functions.
Solution:   Skip over dead functions.

src/userfunc.c
src/version.c

index d91890373adfa8c961c34c6bde4b2d104cc429bf..d5bdadc1885bb98750b55c1d3e643e8d289853ce 100644 (file)
@@ -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);
 
index 54bb12884dcd50aaf765eb5d2f091c5bde8cc2f2..18d2b3ed8e965de3dcd1a15f651d7cf3ecf6dad5 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1643,
 /**/
     1642,
 /**/