0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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>
This commit is contained in:
Yegappan Lakshmanan
2023-10-17 11:00:45 +02:00
committed by Christian Brabandt
parent 209ec90b9b
commit f3eac695bf
9 changed files with 276 additions and 45 deletions

View File

@@ -2039,17 +2039,14 @@ generate_PCALL(
/*
* 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 @@ delete_instr(isn_T *isn)
case ISN_COND2BOOL:
case ISN_DEBUG:
case ISN_DEFER:
case ISN_DEFEROBJ:
case ISN_DROP:
case ISN_ECHO:
case ISN_ECHOCONSOLE: