Mercurial > vim
comparison src/userfunc.c @ 22188:ec0a5ae32d5e v8.2.1643
patch 8.2.1643: Vim9: :defcompile compiles dead functions
Commit: https://github.com/vim/vim/commit/96f8f499ce51ea791d9b044c266f84380fa54848
Author: Bram Moolenaar <Bram@vim.org>
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 09 Sep 2020 17:15:04 +0200 |
parents | 3fe594c72d8c |
children | 3d0632b260fd |
comparison
equal
deleted
inserted
replaced
22187:cc2879441e5d | 22188:ec0a5ae32d5e |
---|---|
3581 { | 3581 { |
3582 (void)def_function(eap, NULL); | 3582 (void)def_function(eap, NULL); |
3583 } | 3583 } |
3584 | 3584 |
3585 /* | 3585 /* |
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. | |
3587 */ | 3588 */ |
3588 void | 3589 void |
3589 ex_defcompile(exarg_T *eap UNUSED) | 3590 ex_defcompile(exarg_T *eap UNUSED) |
3590 { | 3591 { |
3591 long todo = (long)func_hashtab.ht_used; | 3592 long todo = (long)func_hashtab.ht_used; |
3598 if (!HASHITEM_EMPTY(hi)) | 3599 if (!HASHITEM_EMPTY(hi)) |
3599 { | 3600 { |
3600 --todo; | 3601 --todo; |
3601 ufunc = HI2UF(hi); | 3602 ufunc = HI2UF(hi); |
3602 if (ufunc->uf_script_ctx.sc_sid == current_sctx.sc_sid | 3603 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) | |
3604 { | 3606 { |
3605 compile_def_function(ufunc, FALSE, NULL); | 3607 compile_def_function(ufunc, FALSE, NULL); |
3606 | 3608 |
3607 if (func_hashtab.ht_changed != changed) | 3609 if (func_hashtab.ht_changed != changed) |
3608 { | 3610 { |