To: vim_dev@googlegroups.com Subject: Patch 8.2.2101 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2101 Problem: Vim9: memory leak when literal dict has an error and when an expression is not complete. Solution: Clear the typval and the growarray. Files: src/dict.c, src/vim9compile.c *** ../vim-8.2.2100/src/dict.c 2020-12-04 19:11:53.877306973 +0100 --- src/dict.c 2020-12-06 15:57:20.786976378 +0100 *************** *** 929,934 **** --- 929,935 ---- if (**arg != ']') { emsg(_(e_missing_matching_bracket_after_dict_key)); + clear_tv(&tvkey); return FAIL; } ++*arg; *** ../vim-8.2.2100/src/vim9compile.c 2020-12-06 14:37:04.717124932 +0100 --- src/vim9compile.c 2020-12-06 15:58:58.706661673 +0100 *************** *** 4392,4398 **** --- 4392,4401 ---- // eval the next expression *arg = skipwhite(p + 2); if (may_get_next_line_error(p + 2, arg, cctx) == FAIL) + { + ga_clear(&end_ga); return FAIL; + } if ((opchar == '|' ? compile_expr3(arg, cctx, ppconst) : compile_expr4(arg, cctx, ppconst)) == FAIL) *** ../vim-8.2.2100/src/version.c 2020-12-06 15:03:14.821379868 +0100 --- src/version.c 2020-12-06 15:58:22.954776349 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2101, /**/ -- John: When I'm playing tennis with friends I always get carried away George: You hurt your foot each time? /// 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 ///