]> granicus.if.org Git - vim/commitdiff
patch 8.2.4111: potential proglem when map is deleted while executing v8.2.4111
authorBram Moolenaar <Bram@vim.org>
Sun, 16 Jan 2022 14:58:34 +0000 (14:58 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 16 Jan 2022 14:58:34 +0000 (14:58 +0000)
Problem:    Potential proglem when map is deleted while executing.
Solution:   Reset last used map pointer when deleting a mapping.

src/map.c
src/version.c

index 181aa654b6ff0410f2843674cb0316b4ede38b5e..6ad938d7ed6c9aa4bf80be541d7d4489d53f4ce3 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -85,6 +85,9 @@ map_free(mapblock_T **mpp)
     vim_free(mp->m_orig_str);
     *mpp = mp->m_next;
     vim_free(mp);
+#ifdef FEAT_EVAL
+    reset_last_used_map();
+#endif
 }
 
 /*
index b658ec7ae52843b4c8e26112b95965ecaecc5a21..ec1ba92d149355243521d5bb08f1c2b42800355d 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4111,
 /**/
     4110,
 /**/