aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorNoam Postavsky2018-03-30 16:44:24 -0400
committerPaul Eggert2018-03-30 14:26:25 -0700
commit96b8747d5c5d747af13fd84d8fe0308ef2a0ea7a (patch)
tree1b7cd8463b098f6386b0b8be81f1ab755b6308b9 /src/editfns.c
parent842b3d7412eaed6b2c9f90c3361abb4932ec0b1d (diff)
downloademacs-96b8747d5c5d747af13fd84d8fe0308ef2a0ea7a.tar.gz
emacs-96b8747d5c5d747af13fd84d8fe0308ef2a0ea7a.zip
Fix another case of freed markers in the undo-list (Bug#30931)
* src/alloc.c (free_marker): Remove. * src/editfns.c (save_restriction_restore): * src/insdel.c (signal_before_change): Detach the markers from the buffer when we're done with them instead of calling free_marker on them. * test/src/editfns-tests.el (delete-region-undo-markers-1) (delete-region-undo-markers-2): New tests.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 727f2d0080c..84de6792738 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3899,10 +3899,12 @@ save_restriction_restore (Lisp_Object data)
3899 3899
3900 buf->clip_changed = 1; /* Remember that the narrowing changed. */ 3900 buf->clip_changed = 1; /* Remember that the narrowing changed. */
3901 } 3901 }
3902 /* This isn’t needed anymore, so don’t wait for GC. 3902 /* This isn’t needed anymore, so don’t wait for GC. Do not call
3903 Do not call free_marker on XCAR (data) or XCDR (data), 3903 free_marker on XCAR (data) or XCDR (data), though, since
3904 though, since record_marker_adjustments may have put 3904 record_marker_adjustments may have put them on the buffer’s
3905 them on the buffer’s undo list (Bug#30931). */ 3905 undo list (Bug#30931). Just detach them instead. */
3906 Fset_marker (XCAR (data), Qnil, Qnil);
3907 Fset_marker (XCDR (data), Qnil, Qnil);
3906 free_cons (XCONS (data)); 3908 free_cons (XCONS (data));
3907 } 3909 }
3908 else 3910 else