Patch 8.2.4976
Problem:    Coverity complains about not restoring a saved value.
Solution:   Restore value before handling error.
Files:      src/vim9execute.c


*** ../vim-8.2.4975/src/vim9execute.c   2022-05-17 16:12:35.708086414 +0100
--- src/vim9execute.c   2022-05-18 10:58:16.791577825 +0100
***************
*** 4653,4668 ****
                {
                    checktype_T *ct = &iptr->isn_arg.type;
                    int         save_wt_variable = ectx->ec_where.wt_variable;
  
                    tv = STACK_TV_BOT((int)ct->ct_off);
                    SOURCING_LNUM = iptr->isn_lnum;
                    if (!ectx->ec_where.wt_variable)
                        ectx->ec_where.wt_index = ct->ct_arg_idx;
                    ectx->ec_where.wt_variable = ct->ct_is_var;
!                   if (check_typval_type(ct->ct_type, tv, ectx->ec_where)
!                                                                      == FAIL)
!                       goto on_error;
                    ectx->ec_where.wt_variable = save_wt_variable;
                    if (!ectx->ec_where.wt_variable)
                        ectx->ec_where.wt_index = 0;
  
--- 4653,4669 ----
                {
                    checktype_T *ct = &iptr->isn_arg.type;
                    int         save_wt_variable = ectx->ec_where.wt_variable;
+                   int         r;
  
                    tv = STACK_TV_BOT((int)ct->ct_off);
                    SOURCING_LNUM = iptr->isn_lnum;
                    if (!ectx->ec_where.wt_variable)
                        ectx->ec_where.wt_index = ct->ct_arg_idx;
                    ectx->ec_where.wt_variable = ct->ct_is_var;
!                   r = check_typval_type(ct->ct_type, tv, ectx->ec_where);
                    ectx->ec_where.wt_variable = save_wt_variable;
+                   if (r == FAIL)
+                       goto on_error;
                    if (!ectx->ec_where.wt_variable)
                        ectx->ec_where.wt_index = 0;
  
*** ../vim-8.2.4975/src/version.c       2022-05-17 20:10:58.744361606 +0100
--- src/version.c       2022-05-18 10:59:56.583539649 +0100
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4976,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
225. You sign up for free subscriptions for all the computer magazines

 /// 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/20220518100121.B375B1C07AB%40moolenaar.net.

Raspunde prin e-mail lui