diff src/vim9instr.c @ 31441:e572ff386670 v9.0.1053

patch 9.0.1053: default constructor arguments are not optional Commit: https://github.com/vim/vim/commit/65b0d1676814ee08fb58ef8d64dd342d1d883192 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 13 18:43:22 2022 +0000 patch 9.0.1053: default constructor arguments are not optional Problem: Default constructor arguments are not optional. Solution: Use "= v:none" to make constructor arguments optional.
author Bram Moolenaar <Bram@vim.org>
date Tue, 13 Dec 2022 19:45:04 +0100
parents e31fc75f6aff
children 1bebc2093e6b
line wrap: on
line diff
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -1408,15 +1408,15 @@ generate_WHILE(cctx_T *cctx, int funcref
 }
 
 /*
- * 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: