Mirror of the Vim source from https://github.com/vim/vim
Revisão | 8f599b6d9f54c6b4dfff9ba63c458ba350431010 (tree) |
---|---|
Hora | 2022-05-18 19:15:04 |
Autor | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
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
@@ -747,6 +747,8 @@ | ||
747 | 747 | static int included_patches[] = |
748 | 748 | { /* Add new patch number below this line */ |
749 | 749 | /**/ |
750 | + 4976, | |
751 | +/**/ | |
750 | 752 | 4975, |
751 | 753 | /**/ |
752 | 754 | 4974, |
@@ -4653,16 +4653,17 @@ | ||
4653 | 4653 | { |
4654 | 4654 | checktype_T *ct = &iptr->isn_arg.type; |
4655 | 4655 | int save_wt_variable = ectx->ec_where.wt_variable; |
4656 | + int r; | |
4656 | 4657 | |
4657 | 4658 | tv = STACK_TV_BOT((int)ct->ct_off); |
4658 | 4659 | SOURCING_LNUM = iptr->isn_lnum; |
4659 | 4660 | if (!ectx->ec_where.wt_variable) |
4660 | 4661 | ectx->ec_where.wt_index = ct->ct_arg_idx; |
4661 | 4662 | 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) | |
4664 | 4666 | goto on_error; |
4665 | - ectx->ec_where.wt_variable = save_wt_variable; | |
4666 | 4667 | if (!ectx->ec_where.wt_variable) |
4667 | 4668 | ectx->ec_where.wt_index = 0; |
4668 | 4669 |