Patch 9.0.0926
Problem: Coverity warns for not using return value of dict_add().
Solution: When dict_add() fails then don't call hash_remove().
Files: src/dict.c
*** ../vim-9.0.0925/src/dict.c 2022-11-22 12:40:44.066427878 +0000
--- src/dict.c 2022-11-23 11:29:52.442448895 +0000
***************
*** 1122,1131 ****
{
if (*action == 'm')
{
! // cheap way to move a dict item from "d2" to "d1"
di1 = HI2DI(hi2);
! dict_add(d1, di1);
! hash_remove(&d2->dv_hashtab, hi2);
}
else
{
--- 1122,1132 ----
{
if (*action == 'm')
{
! // Cheap way to move a dict item from "d2" to "d1".
! // If dict_add() fails then "d2" won't be empty.
di1 = HI2DI(hi2);
! if (dict_add(d1, di1) == OK)
! hash_remove(&d2->dv_hashtab, hi2);
}
else
{
*** ../vim-9.0.0925/src/version.c 2022-11-23 11:23:14.539539089 +0000
--- src/version.c 2022-11-23 11:31:36.826252869 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 926,
/**/
--
Amnesia is one of my favorite words, but I forgot what it means.
/// 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/20221123113427.8B25C1C211B%40moolenaar.net.