diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-08 13:18:55 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-08 13:18:55 +0000 |
commit | 8acb9cc6209768ca7ec75c9f7af8c389312ea8d6 (patch) | |
tree | 8a5f92b1b10f53f7a3f0e95ffbdcb519ce9ecb09 /src/vim9instr.c | |
parent | 08238045e769fce2d5bf1e17167e26eafc3d72b8 (diff) | |
download | vim-git-8acb9cc6209768ca7ec75c9f7af8c389312ea8d6.tar.gz |
patch 8.2.4526: Vim9: cannot set variables to a null valuev8.2.4526
Problem: Vim9: cannot set variables to a null value.
Solution: Add null_list, null_job, etc.
Diffstat (limited to 'src/vim9instr.c')
-rw-r--r-- | src/vim9instr.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/vim9instr.c b/src/vim9instr.c index 2c76fadc3..7fbf529a6 100644 --- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -570,6 +570,40 @@ generate_tv_PUSH(cctx_T *cctx, typval_T *tv) generate_PUSHBLOB(cctx, tv->vval.v_blob); tv->vval.v_blob = NULL; break; + case VAR_LIST: + if (tv->vval.v_list != NULL) + iemsg("non-empty list constant not supported"); + generate_NEWLIST(cctx, 0); + break; + case VAR_DICT: + if (tv->vval.v_dict != NULL) + iemsg("non-empty dict constant not supported"); + generate_NEWDICT(cctx, 0); + break; +#ifdef FEAT_JOB_CHANNEL + case VAR_JOB: + if (tv->vval.v_job != NULL) + iemsg("non-null job constant not supported"); + generate_PUSHJOB(cctx, NULL); + break; + case VAR_CHANNEL: + if (tv->vval.v_channel != NULL) + iemsg("non-null channel constant not supported"); + generate_PUSHCHANNEL(cctx, NULL); + break; +#endif + case VAR_FUNC: + if (tv->vval.v_string != NULL) + iemsg("non-null function constant not supported"); + generate_PUSHFUNC(cctx, NULL, &t_func_unknown); + break; + case VAR_PARTIAL: + if (tv->vval.v_partial != NULL) + iemsg("non-null partial constant not supported"); + if (generate_instr_type(cctx, ISN_NEWPARTIAL, &t_func_unknown) + == NULL) + return FAIL; + break; case VAR_STRING: generate_PUSHS(cctx, &tv->vval.v_string); tv->vval.v_string = NULL; @@ -706,7 +740,7 @@ generate_PUSHJOB(cctx_T *cctx, job_T *job) isn_T *isn; RETURN_OK_IF_SKIP(cctx); - if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_channel)) == NULL) + if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_job)) == NULL) return FAIL; isn->isn_arg.job = job; @@ -2185,6 +2219,7 @@ delete_instr(isn_T *isn) case ISN_NEGATENR: case ISN_NEWDICT: case ISN_NEWLIST: + case ISN_NEWPARTIAL: case ISN_OPANY: case ISN_OPFLOAT: case ISN_OPNR: |