Problem: Vim9: memory leak when compiling :elseif fails.
Solution: Cleanup ppconst.
CheckDefAndScriptFailure(lines, 'E1135:', 3)
lines =<< trim END
+ g:cond = 0
+ if g:cond
+ elseif 'text' garbage
+ endif
+ END
+ CheckDefAndScriptFailure(lines, 'E488:', 3)
+
+ lines =<< trim END
+ g:cond = 0
if g:cond
elseif [1]
endif
END
- CheckDefFailure(lines, 'E1012:', 2)
- CheckScriptFailure(['vim9script'] + lines, 'E745:', 3)
+ CheckDefFailure(lines, 'E1012:', 3)
+ CheckScriptFailure(['vim9script'] + lines, 'E745:', 4)
lines =<< trim END
g:cond = 'text'
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3711,
/**/
3710,
/**/
cctx->ctx_skip = save_skip;
if (!ends_excmd2(arg, skipwhite(p)))
{
+ clear_ppconst(&ppconst);
semsg(_(e_trailing_arg), p);
return NULL;
}
// The expression result is a constant.
v = tv_get_bool_chk(&ppconst.pp_tv[0], &error);
if (error)
+ {
+ clear_ppconst(&ppconst);
return NULL;
+ }
cctx->ctx_skip = v ? SKIP_NOT : SKIP_YES;
clear_ppconst(&ppconst);
scope->se_u.se_if.is_if_label = -1;