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)
diff --git a/src/vim9instr.c b/src/vim9instr.c
index 5a5e3c5..93ac062 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -755,12 +755,19 @@
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 @@
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
}
/*