summaryrefslogtreecommitdiff
path: root/src/vim9instr.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-13 18:43:22 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-13 18:43:22 +0000
commit65b0d1676814ee08fb58ef8d64dd342d1d883192 (patch)
tree4fbd70e4211e702a5212c717fe09636222f23026 /src/vim9instr.c
parent692fe0889c44d97c4a1cc822bc8de189859c51cb (diff)
downloadvim-git-9.0.1053.tar.gz
patch 9.0.1053: default constructor arguments are not optionalv9.0.1053
Problem: Default constructor arguments are not optional. Solution: Use "= v:none" to make constructor arguments optional.
Diffstat (limited to 'src/vim9instr.c')
-rw-r--r--src/vim9instr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vim9instr.c b/src/vim9instr.c
index 49f8c5212..47114f08c 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -1408,15 +1408,15 @@ generate_WHILE(cctx_T *cctx, int funcref_idx)
}
/*
- * Generate an ISN_JUMP_IF_ARG_SET instruction.
+ * Generate an ISN_JUMP_IF_ARG_SET or ISN_JUMP_IF_ARG_NOT_SET instruction.
*/
int
-generate_JUMP_IF_ARG_SET(cctx_T *cctx, int arg_off)
+generate_JUMP_IF_ARG(cctx_T *cctx, isntype_T isn_type, int arg_off)
{
isn_T *isn;
RETURN_OK_IF_SKIP(cctx);
- if ((isn = generate_instr(cctx, ISN_JUMP_IF_ARG_SET)) == NULL)
+ if ((isn = generate_instr(cctx, isn_type)) == NULL)
return FAIL;
isn->isn_arg.jumparg.jump_arg_off = arg_off;
// jump_where is set later
@@ -2479,6 +2479,7 @@ delete_instr(isn_T *isn)
case ISN_GETITEM:
case ISN_GET_OBJ_MEMBER:
case ISN_JUMP:
+ case ISN_JUMP_IF_ARG_NOT_SET:
case ISN_JUMP_IF_ARG_SET:
case ISN_LISTAPPEND:
case ISN_LISTINDEX: