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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202104211020.13LAK2vI1073773%40masaka.moolenaar.net.

Raspunde prin e-mail lui