Patch 8.2.0821

6 views
Skip to first unread message

Bram Moolenaar

unread,
May 24, 2020, 6:29:11 PM5/24/20
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages