Patch 8.2.2795

7 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 21, 2021, 6:20:21 AM4/21/21
to vim...@googlegroups.com

Patch 8.2.2795
Problem: Coverity warns for not using return value.
Solution: Check the return value of compiling the substitute expression.
Files: src/vim9compile.c


*** ../vim-8.2.2794/src/vim9compile.c 2021-04-20 21:49:32.231668519 +0200
--- src/vim9compile.c 2021-04-21 12:17:36.811361170 +0200
***************
*** 6511,6517 ****
{
// skip over the "=" and the expression
p = skipwhite(op + oplen);
! compile_expr0(&p, cctx);
}
}
else if (oplen > 0)
--- 6511,6517 ----
{
// skip over the "=" and the expression
p = skipwhite(op + oplen);
! (void)compile_expr0(&p, cctx);
}
}
else if (oplen > 0)
***************
*** 8525,8530 ****
--- 8525,8531 ----
{
garray_T save_ga = cctx->ctx_instr;
char_u *end;
+ int expr_res;
int trailing_error;
int instr_count;
isn_T *instr = NULL;
***************
*** 8538,8550 ****
cctx->ctx_instr.ga_len = 0;
cctx->ctx_instr.ga_maxlen = 0;
cctx->ctx_instr.ga_data = NULL;
! compile_expr0(&cmd, cctx);
if (end[-1] == NUL)
end[-1] = delimiter;
cmd = skipwhite(cmd);
trailing_error = *cmd != delimiter && *cmd != NUL;

! if (trailing_error || ga_grow(&cctx->ctx_instr, 1) == FAIL)
{
if (trailing_error)
semsg(_(e_trailing_arg), cmd);
--- 8539,8552 ----
cctx->ctx_instr.ga_len = 0;
cctx->ctx_instr.ga_maxlen = 0;
cctx->ctx_instr.ga_data = NULL;
! expr_res = compile_expr0(&cmd, cctx);
if (end[-1] == NUL)
end[-1] = delimiter;
cmd = skipwhite(cmd);
trailing_error = *cmd != delimiter && *cmd != NUL;

! if (expr_res == FAIL || trailing_error
! || ga_grow(&cctx->ctx_instr, 1) == FAIL)
{
if (trailing_error)
semsg(_(e_trailing_arg), cmd);
*** ../vim-8.2.2794/src/version.c 2021-04-21 11:57:56.214840116 +0200
--- src/version.c 2021-04-21 12:19:20.523047029 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2795,
/**/

--
hundred-and-one symptoms of being an internet addict:
134. You consider bandwidth to be more important than carats.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages