Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
28677:aefbe6115141 | 28678:a16dae0be398 |
---|---|
753 * Generate an ISN_PUSHCHANNEL instruction. Channel is always NULL. | 753 * Generate an ISN_PUSHCHANNEL instruction. Channel is always NULL. |
754 */ | 754 */ |
755 int | 755 int |
756 generate_PUSHCHANNEL(cctx_T *cctx) | 756 generate_PUSHCHANNEL(cctx_T *cctx) |
757 { | 757 { |
758 isn_T *isn; | 758 #ifdef FEAT_JOB_CHANNEL |
759 | 759 isn_T *isn; |
760 RETURN_OK_IF_SKIP(cctx); | 760 #endif |
761 | |
762 RETURN_OK_IF_SKIP(cctx); | |
763 #ifdef FEAT_JOB_CHANNEL | |
761 if ((isn = generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel)) == NULL) | 764 if ((isn = generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel)) == NULL) |
762 return FAIL; | 765 return FAIL; |
763 return OK; | 766 return OK; |
767 #else | |
768 emsg(_(e_channel_job_feature_not_available)); | |
769 return FAIL; | |
770 #endif | |
764 } | 771 } |
765 | 772 |
766 /* | 773 /* |
767 * Generate an ISN_PUSHJOB instruction. Job is always NULL. | 774 * Generate an ISN_PUSHJOB instruction. Job is always NULL. |
768 */ | 775 */ |
769 int | 776 int |
770 generate_PUSHJOB(cctx_T *cctx) | 777 generate_PUSHJOB(cctx_T *cctx) |
771 { | 778 { |
772 isn_T *isn; | 779 #ifdef FEAT_JOB_CHANNEL |
773 | 780 isn_T *isn; |
774 RETURN_OK_IF_SKIP(cctx); | 781 #endif |
782 | |
783 RETURN_OK_IF_SKIP(cctx); | |
784 #ifdef FEAT_JOB_CHANNEL | |
775 if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_job)) == NULL) | 785 if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_job)) == NULL) |
776 return FAIL; | 786 return FAIL; |
777 return OK; | 787 return OK; |
788 #else | |
789 emsg(_(e_channel_job_feature_not_available)); | |
790 return FAIL; | |
791 #endif | |
778 } | 792 } |
779 | 793 |
780 /* | 794 /* |
781 * Generate an ISN_PUSHBLOB instruction. | 795 * Generate an ISN_PUSHBLOB instruction. |
782 * Consumes "blob". | 796 * Consumes "blob". |