mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.1720: Vim9: memory leak with heredoc that isn't executed
Problem: Vim9: memory leak with heredoc that isn't executed. (Dominique Pellé) Solution: Don't clear the list items. (closes #6991)
This commit is contained in:
@@ -259,6 +259,14 @@ def Test_assignment()
|
|||||||
let w: number
|
let w: number
|
||||||
w = 123
|
w = 123
|
||||||
assert_equal(123, w)
|
assert_equal(123, w)
|
||||||
|
|
||||||
|
|
||||||
|
# this should not leak
|
||||||
|
if 0
|
||||||
|
let text =<< trim END
|
||||||
|
some text
|
||||||
|
END
|
||||||
|
endif
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_vim9_single_char_vars()
|
def Test_vim9_single_char_vars()
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1720,
|
||||||
/**/
|
/**/
|
||||||
1719,
|
1719,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -4622,15 +4622,18 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
|
|||||||
eap->cookie = cctx;
|
eap->cookie = cctx;
|
||||||
l = heredoc_get(eap, op + 3, FALSE);
|
l = heredoc_get(eap, op + 3, FALSE);
|
||||||
|
|
||||||
// Push each line and the create the list.
|
if (cctx->ctx_skip != SKIP_YES)
|
||||||
FOR_ALL_LIST_ITEMS(l, li)
|
|
||||||
{
|
{
|
||||||
generate_PUSHS(cctx, li->li_tv.vval.v_string);
|
// Push each line and the create the list.
|
||||||
li->li_tv.vval.v_string = NULL;
|
FOR_ALL_LIST_ITEMS(l, li)
|
||||||
|
{
|
||||||
|
generate_PUSHS(cctx, li->li_tv.vval.v_string);
|
||||||
|
li->li_tv.vval.v_string = NULL;
|
||||||
|
}
|
||||||
|
generate_NEWLIST(cctx, l->lv_len);
|
||||||
|
type = &t_list_string;
|
||||||
|
member_type = &t_list_string;
|
||||||
}
|
}
|
||||||
generate_NEWLIST(cctx, l->lv_len);
|
|
||||||
type = &t_list_string;
|
|
||||||
member_type = &t_list_string;
|
|
||||||
list_free(l);
|
list_free(l);
|
||||||
p += STRLEN(p);
|
p += STRLEN(p);
|
||||||
end = p;
|
end = p;
|
||||||
|
Reference in New Issue
Block a user