To: vim_dev@googlegroups.com Subject: Patch 8.2.4976 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///