diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-04 16:46:54 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-04 16:46:54 +0100 |
commit | c9af617ac62b15bfcbbfe8c54071146e2af01f65 (patch) | |
tree | d0eb268898ca64788550bf8ef728bf0ee5637ebb /src/vim9instr.c | |
parent | 23d44493f1e82365f0a1dbd372fc2546811942f4 (diff) |
patch 8.2.4863: accessing freed memory in test without the +channel featurev8.2.4863
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)
Diffstat (limited to 'src/vim9instr.c')
-rw-r--r-- | src/vim9instr.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vim9instr.c b/src/vim9instr.c index 5a5e3c5ab8..93ac062a33 100644 --- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -755,12 +755,19 @@ generate_PUSHS(cctx_T *cctx, char_u **str) 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 } /* |