patch 9.0.2038: Vim9: object method funcref not cleaned up after use
Problem: Vim9: object method funcref not cleaned up after use
Solution: Clean up type stack after using object method funcref,
remove now longer used ISN_DEFEROBJ instrunction
closes: #13360
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
diff --git a/src/vim9instr.c b/src/vim9instr.c
index f7b074c..8ee9e7c 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -2039,17 +2039,14 @@
/*
* Generate an ISN_DEFER instruction.
- * "obj_method" is one for "obj.Method()", zero otherwise.
*/
int
-generate_DEFER(cctx_T *cctx, int var_idx, int obj_method, int argcount)
+generate_DEFER(cctx_T *cctx, int var_idx, int argcount)
{
isn_T *isn;
RETURN_OK_IF_SKIP(cctx);
- if ((isn = generate_instr_drop(cctx,
- obj_method == 0 ? ISN_DEFER : ISN_DEFEROBJ,
- argcount + 1)) == NULL)
+ if ((isn = generate_instr_drop(cctx, ISN_DEFER, argcount + 1)) == NULL)
return FAIL;
isn->isn_arg.defer.defer_var_idx = var_idx;
isn->isn_arg.defer.defer_argcount = argcount;
@@ -2711,7 +2708,6 @@
case ISN_COND2BOOL:
case ISN_DEBUG:
case ISN_DEFER:
- case ISN_DEFEROBJ:
case ISN_DROP:
case ISN_ECHO:
case ISN_ECHOCONSOLE: