To: vim_dev@googlegroups.com Subject: Patch 8.2.0556 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0556 Problem: Vim9: memory leak when finding common type. Solution: Store allocated memory in type growarray. Files: src/vim9compile.c *** ../vim-8.2.0555/src/vim9compile.c 2020-04-12 16:38:54.775938935 +0200 --- src/vim9compile.c 2020-04-12 17:08:55.975907361 +0200 *************** *** 1823,1830 **** *dest = alloc_func_type(common, argcount, type_gap); if (type1->tt_args != NULL && type2->tt_args != NULL) { ! (*dest)->tt_args = ALLOC_CLEAR_MULT(type_T *, argcount); ! if ((*dest)->tt_args != NULL) for (i = 0; i < argcount; ++i) common_type(type1->tt_args[i], type2->tt_args[i], &(*dest)->tt_args[i], type_gap); --- 1823,1830 ---- *dest = alloc_func_type(common, argcount, type_gap); if (type1->tt_args != NULL && type2->tt_args != NULL) { ! if (func_type_add_arg_types(*dest, argcount, ! type_gap) == OK) for (i = 0; i < argcount; ++i) common_type(type1->tt_args[i], type2->tt_args[i], &(*dest)->tt_args[i], type_gap); *** ../vim-8.2.0555/src/version.c 2020-04-12 16:38:54.775938935 +0200 --- src/version.c 2020-04-12 17:11:00.551630381 +0200 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 556, /**/ -- People who want to share their religious views with you almost never want you to share yours with them. /// Bram Moolenaar -- Bram@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 ///