]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2144: garbage collection may invalidate the recorded buffer changes v9.1.2144
authorPaul Ollis <paul@cleversheep.org>
Mon, 9 Feb 2026 19:30:14 +0000 (19:30 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 9 Feb 2026 19:32:51 +0000 (19:32 +0000)
Problem:  When garbage collection runs, the list of recorded buffer
  changes may be incorrectly freed (Sainnhe Park).
Solution: In garbage_collect(), iterate through all buffers and call
          set_ref_in_list() for b_recorded_changes to ensure the list
          and its contents are marked as reachable (Paul Ollis).

fixes:  #19300
closes: #19375

Signed-off-by: Paul Ollis <paul@cleversheep.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/version9.txt
src/gc.c
src/version.c

index 462a048486d065dab476530666f7915eb00dec29..880ea1f706225c0fdfcbb2ce5fc5dd32153b8ef3 100644 (file)
@@ -52542,4 +52542,11 @@ Problem:  When a popup window partially overlaps a wide character
 Solution: When a wide character is partially blocked by a popup, clear both
           cells in the screen buffer to prevent garbage (Yasuhiro Matsumoto).
 
+Patch 9.1.2144
+Problem:  When garbage collection runs, the list of recorded buffer
+         changes may be incorrectly freed (Sainnhe Park). 
+Solution: In garbage_collect(), iterate through all buffers and call
+          set_ref_in_list() for b_recorded_changes to ensure the list
+          and its contents are marked as reachable (Paul Ollis).
+
  vim:tw=78:ts=8:noet:ft=help:norl:fdm=manual:nofoldenable
index d1f53991ab23e8100b76646d1024cdafb5807be9..f15d1dffe0c284ca15bfcff83c149908ac89d5ba 100644 (file)
--- a/src/gc.c
+++ b/src/gc.c
@@ -121,8 +121,11 @@ garbage_collect(int testing)
 
     // buffer-local variables
     FOR_ALL_BUFFERS(buf)
+    {
        abort = abort || set_ref_in_item(&buf->b_bufvar.di_tv, copyID,
                                                        NULL, NULL, NULL);
+       abort = abort || set_ref_in_list(buf->b_recorded_changes, copyID);
+    }
 
     // window-local variables
     FOR_ALL_TAB_WINDOWS(tp, wp)
index 24f3ea3cee7a0d5ba26c796c35374c10fb89aa7d..f677f448a574a35fd279fa69ac0dba71785286dd 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2144,
 /**/
     2143,
 /**/