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