diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/alloc.c | 9 | ||||
-rw-r--r-- | src/editfns.c | 10 | ||||
-rw-r--r-- | src/insdel.c | 7 | ||||
-rw-r--r-- | src/lisp.h | 1 |
4 files changed, 11 insertions, 16 deletions
diff --git a/src/alloc.c b/src/alloc.c index 369592d70ee..9fdcc7306a8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3878,15 +3878,6 @@ build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos) return obj; } -/* Put MARKER back on the free list after using it temporarily. */ - -void -free_marker (Lisp_Object marker) -{ - unchain_marker (XMARKER (marker)); - free_misc (marker); -} - /* Return a newly created vector or string with specified arguments as elements. If all the arguments are characters that can fit 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) buf->clip_changed = 1; /* Remember that the narrowing changed. */ } - /* This isn’t needed anymore, so don’t wait for GC. - Do not call free_marker on XCAR (data) or XCDR (data), - though, since record_marker_adjustments may have put - them on the buffer’s undo list (Bug#30931). */ + /* This isn’t needed anymore, so don’t wait for GC. Do not call + free_marker on XCAR (data) or XCDR (data), though, since + record_marker_adjustments may have put them on the buffer’s + undo list (Bug#30931). Just detach them instead. */ + Fset_marker (XCAR (data), Qnil, Qnil); + Fset_marker (XCDR (data), Qnil, Qnil); free_cons (XCONS (data)); } else diff --git a/src/insdel.c b/src/insdel.c index 02e3f41bc9f..697395c507b 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -2148,10 +2148,13 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int, FETCH_START, FETCH_END, Qnil); } + /* Detach the markers now that we're done with them. Don't directly + free them, since the change functions could have caused them to + be inserted into the undo list (Bug#30931). */ if (! NILP (start_marker)) - free_marker (start_marker); + Fset_marker (start_marker, Qnil, Qnil); if (! NILP (end_marker)) - free_marker (end_marker); + Fset_marker (end_marker, Qnil, Qnil); RESTORE_VALUE; unbind_to (count, Qnil); diff --git a/src/lisp.h b/src/lisp.h index b931d23bf38..f471b216587 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3812,7 +3812,6 @@ extern Lisp_Object make_save_funcptr_ptr_obj (void (*) (void), void *, extern Lisp_Object make_save_memory (Lisp_Object *, ptrdiff_t); extern void free_save_value (Lisp_Object); extern Lisp_Object build_overlay (Lisp_Object, Lisp_Object, Lisp_Object); -extern void free_marker (Lisp_Object); extern void free_cons (struct Lisp_Cons *); extern void init_alloc_once (void); extern void init_alloc (void); |