Mercurial > vim
diff src/vim9instr.c @ 28678:a16dae0be398 v8.2.4863
patch 8.2.4863: accessing freed memory in test without the +channel feature
Commit: https://github.com/vim/vim/commit/c9af617ac62b15bfcbbfe8c54071146e2af01f65
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed May 4 16:46:54 2022 +0100
patch 8.2.4863: accessing freed memory in test without the +channel feature
Problem: Accessing freed memory in test without the +channel feature.
(Dominique Pell?)
Solution: Do not generted PUSHCHANNEL or PUSHJOB if they are not
implemented. (closes #10350)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 04 May 2022 18:00:04 +0200 |
parents | 333be301dfe8 |
children | 3626ca6a20ea |
line wrap: on
line diff
--- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -755,12 +755,19 @@ generate_PUSHS(cctx_T *cctx, char_u **st int generate_PUSHCHANNEL(cctx_T *cctx) { +#ifdef FEAT_JOB_CHANNEL isn_T *isn; +#endif RETURN_OK_IF_SKIP(cctx); +#ifdef FEAT_JOB_CHANNEL if ((isn = generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel)) == NULL) return FAIL; return OK; +#else + emsg(_(e_channel_job_feature_not_available)); + return FAIL; +#endif } /* @@ -769,12 +776,19 @@ generate_PUSHCHANNEL(cctx_T *cctx) int generate_PUSHJOB(cctx_T *cctx) { +#ifdef FEAT_JOB_CHANNEL isn_T *isn; +#endif RETURN_OK_IF_SKIP(cctx); +#ifdef FEAT_JOB_CHANNEL if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_job)) == NULL) return FAIL; return OK; +#else + emsg(_(e_channel_job_feature_not_available)); + return FAIL; +#endif } /*