• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisão8f599b6d9f54c6b4dfff9ba63c458ba350431010 (tree)
Hora2022-05-18 19:15:04
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Mensagem de Log

patch 8.2.4976: Coverity complains about not restoring a saved value

Commit: https://github.com/vim/vim/commit/b1040dc11fa15818eda724c35a334f460cf98005
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed May 18 11:00:48 2022 +0100

patch 8.2.4976: Coverity complains about not restoring a saved value
Problem: Coverity complains about not restoring a saved value.
Solution: Restore value before handling error.

Mudança Sumário

Diff

diff -r d43069214fa6 -r 8f599b6d9f54 src/version.c
--- a/src/version.c Tue May 17 21:15:04 2022 +0200
+++ b/src/version.c Wed May 18 12:15:04 2022 +0200
@@ -747,6 +747,8 @@
747747 static int included_patches[] =
748748 { /* Add new patch number below this line */
749749 /**/
750+ 4976,
751+/**/
750752 4975,
751753 /**/
752754 4974,
diff -r d43069214fa6 -r 8f599b6d9f54 src/vim9execute.c
--- a/src/vim9execute.c Tue May 17 21:15:04 2022 +0200
+++ b/src/vim9execute.c Wed May 18 12:15:04 2022 +0200
@@ -4653,16 +4653,17 @@
46534653 {
46544654 checktype_T *ct = &iptr->isn_arg.type;
46554655 int save_wt_variable = ectx->ec_where.wt_variable;
4656+ int r;
46564657
46574658 tv = STACK_TV_BOT((int)ct->ct_off);
46584659 SOURCING_LNUM = iptr->isn_lnum;
46594660 if (!ectx->ec_where.wt_variable)
46604661 ectx->ec_where.wt_index = ct->ct_arg_idx;
46614662 ectx->ec_where.wt_variable = ct->ct_is_var;
4662- if (check_typval_type(ct->ct_type, tv, ectx->ec_where)
4663- == FAIL)
4663+ r = check_typval_type(ct->ct_type, tv, ectx->ec_where);
4664+ ectx->ec_where.wt_variable = save_wt_variable;
4665+ if (r == FAIL)
46644666 goto on_error;
4665- ectx->ec_where.wt_variable = save_wt_variable;
46664667 if (!ectx->ec_where.wt_variable)
46674668 ectx->ec_where.wt_index = 0;
46684669
Show on old repository browser