patch 8.2.2314: Vim9: returning zero takes two instructions
Problem: Vim9: returning zero takes two instructions.
Solution: Add ISN_RETURN_ZERO.
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 44180b8..9a76cc9 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2205,6 +2205,16 @@
break;
// return from a :def function call
+ case ISN_RETURN_ZERO:
+ if (GA_GROW(&ectx.ec_stack, 1) == FAIL)
+ goto failed;
+ tv = STACK_TV_BOT(0);
+ ++ectx.ec_stack.ga_len;
+ tv->v_type = VAR_NUMBER;
+ tv->vval.v_number = 0;
+ tv->v_lock = 0;
+ // FALLTHROUGH
+
case ISN_RETURN:
{
garray_T *trystack = &ectx.ec_trystack;
@@ -3804,6 +3814,9 @@
case ISN_RETURN:
smsg("%4d RETURN", current);
break;
+ case ISN_RETURN_ZERO:
+ smsg("%4d RETURN 0", current);
+ break;
case ISN_FUNCREF:
{
funcref_T *funcref = &iptr->isn_arg.funcref;