Patch 8.2.0821
Problem: Vim9: memory leak in expr test.
Solution: Do not decrement the length of the list of functions if the
current function is not at the end.
Files: src/vim9compile.c
*** ../vim-8.2.0820/src/vim9compile.c 2020-05-24 23:45:20.525386105 +0200
--- src/vim9compile.c 2020-05-25 00:26:48.937015671 +0200
***************
*** 1443,1449 ****
}
}
if (ufunc->uf_dfunc_idx == UF_TO_BE_COMPILED)
! if (compile_def_function(ufunc, TRUE, cctx) == FAIL)
return FAIL;
}
--- 1443,1449 ----
}
}
if (ufunc->uf_dfunc_idx == UF_TO_BE_COMPILED)
! if (compile_def_function(ufunc, TRUE, NULL) == FAIL)
return FAIL;
}
***************
*** 6776,6784 ****
delete_instr(((isn_T *)instr->ga_data) + idx);
ga_clear(instr);
! ufunc->uf_dfunc_idx = UF_NOT_COMPILED;
! if (!dfunc->df_deleted)
--def_functions.ga_len;
while (cctx.ctx_scope != NULL)
drop_scope(&cctx);
--- 6776,6786 ----
delete_instr(((isn_T *)instr->ga_data) + idx);
ga_clear(instr);
! // if using the last entry in the table we might as well remove it
! if (!dfunc->df_deleted
! && ufunc->uf_dfunc_idx == def_functions.ga_len - 1)
--def_functions.ga_len;
+ ufunc->uf_dfunc_idx = UF_NOT_COMPILED;
while (cctx.ctx_scope != NULL)
drop_scope(&cctx);
*** ../vim-8.2.0820/src/version.c 2020-05-24 23:45:20.529386094 +0200
--- src/version.c 2020-05-25 00:01:58.021943351 +0200
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 821,
/**/
--
If Microsoft would build a car...
... Occasionally, executing a maneuver such as a left turn
would cause your car to shut down and refuse to restart, in
which case you would have to reinstall the engine.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202005242229.04OMT0jl165263%40masaka.moolenaar.net.