Mercurial > vim
diff src/vim9execute.c @ 28156:088d8dc22045 v8.2.4602
patch 8.2.4602: Vim9: not enough test coverage for executing :def function
Commit: https://github.com/vim/vim/commit/397a87ac1c9857eb0d5ec3add69e3b9ab6b0c77c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 20 21:14:15 2022 +0000
patch 8.2.4602: Vim9: not enough test coverage for executing :def function
Problem: Vim9: not enough test coverage for executing :def function.
Solution: Add a few more tests. Fix uncovered problem. Remove dead code.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 20 Mar 2022 22:15:02 +0100 |
parents | b96409b84eaf |
children | 662d2d5db9a6 |
line wrap: on
line diff
--- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -2611,8 +2611,10 @@ exec_instructions(ectx_T *ectx) case ISN_CEXPR_AUCMD: #ifdef FEAT_QUICKFIX + force_abort = TRUE; if (trigger_cexpr_autocmd(iptr->isn_arg.number) == FAIL) goto on_error; + force_abort = FALSE; #endif break; @@ -3040,7 +3042,9 @@ exec_instructions(ectx_T *ectx) s = tv2string(tv, &tofree, numbuf, 0); if (s == NULL || *s == NUL) { + // cannot happen? clear_tv(tv); + vim_free(tofree); goto on_error; } } @@ -3270,17 +3274,13 @@ exec_instructions(ectx_T *ectx) case ISN_PUSHCHANNEL: #ifdef FEAT_JOB_CHANNEL tv->v_type = VAR_CHANNEL; - tv->vval.v_channel = iptr->isn_arg.channel; - if (tv->vval.v_channel != NULL) - ++tv->vval.v_channel->ch_refcount; + tv->vval.v_channel = NULL; #endif break; case ISN_PUSHJOB: #ifdef FEAT_JOB_CHANNEL tv->v_type = VAR_JOB; - tv->vval.v_job = iptr->isn_arg.job; - if (tv->vval.v_job != NULL) - ++tv->vval.v_job->jv_refcount; + tv->vval.v_job = NULL; #endif break; default: @@ -5644,26 +5644,12 @@ list_instructions(char *pfx, isn_T *inst break; case ISN_PUSHCHANNEL: #ifdef FEAT_JOB_CHANNEL - { - channel_T *channel = iptr->isn_arg.channel; - - smsg("%s%4d PUSHCHANNEL %d", pfx, current, - channel == NULL ? 0 : channel->ch_id); - } + smsg("%s%4d PUSHCHANNEL 0", pfx, current); #endif break; case ISN_PUSHJOB: #ifdef FEAT_JOB_CHANNEL - { - typval_T tv; - char_u *name; - char_u buf[NUMBUFLEN]; - - tv.v_type = VAR_JOB; - tv.vval.v_job = iptr->isn_arg.job; - name = job_to_string_buf(&tv, buf); - smsg("%s%4d PUSHJOB \"%s\"", pfx, current, name); - } + smsg("%s%4d PUSHJOB \"no process\"", pfx, current); #endif break; case ISN_PUSHEXC: