mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.0716: Vim9: another memory leak
Problem: Vim9: another memory leak. Solution: Clear typval when failing.
This commit is contained in:
@@ -746,6 +746,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 */
|
||||||
|
/**/
|
||||||
|
716,
|
||||||
/**/
|
/**/
|
||||||
715,
|
715,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -4074,12 +4074,16 @@ compile_expr7(
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle following "[]", ".member", etc.
|
||||||
|
// Then deal with prefixed '-', '+' and '!', if not done already.
|
||||||
if (compile_subscript(arg, cctx, &start_leader, end_leader,
|
if (compile_subscript(arg, cctx, &start_leader, end_leader,
|
||||||
bef1_tv, bef2_tv, new_tv) == FAIL)
|
bef1_tv, bef2_tv, new_tv) == FAIL
|
||||||
|
|| compile_leader(cctx, start_leader, end_leader) == FAIL)
|
||||||
|
{
|
||||||
|
clear_tv(new_tv);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
// Now deal with prefixed '-', '+' and '!', if not done already.
|
return OK;
|
||||||
return compile_leader(cctx, start_leader, end_leader);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -4187,6 +4191,7 @@ compile_expr5(char_u **arg, cctx_T *cctx)
|
|||||||
{
|
{
|
||||||
char_u buf[3];
|
char_u buf[3];
|
||||||
|
|
||||||
|
clear_tv(&tv1);
|
||||||
vim_strncpy(buf, op, oplen);
|
vim_strncpy(buf, op, oplen);
|
||||||
semsg(_(e_white_both), buf);
|
semsg(_(e_white_both), buf);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@@ -4194,12 +4199,18 @@ compile_expr5(char_u **arg, cctx_T *cctx)
|
|||||||
|
|
||||||
*arg = skipwhite(op + oplen);
|
*arg = skipwhite(op + oplen);
|
||||||
if (may_get_next_line(op + oplen, arg, cctx) == FAIL)
|
if (may_get_next_line(op + oplen, arg, cctx) == FAIL)
|
||||||
|
{
|
||||||
|
clear_tv(&tv1);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
// get the second expression
|
// get the second expression
|
||||||
tv2.v_type = VAR_UNKNOWN;
|
tv2.v_type = VAR_UNKNOWN;
|
||||||
if (compile_expr6(arg, cctx, &tv1, &tv2) == FAIL)
|
if (compile_expr6(arg, cctx, &tv1, &tv2) == FAIL)
|
||||||
|
{
|
||||||
|
clear_tv(&tv1);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
if (*op == '+' && tv1.v_type == VAR_NUMBER && tv2.v_type == VAR_NUMBER)
|
if (*op == '+' && tv1.v_type == VAR_NUMBER && tv2.v_type == VAR_NUMBER)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user