From d2db1c32fa78470ed55f7cdd2ddeb1adfb070404 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 17 May 2004 12:08:02 +0000 Subject: [PATCH] (mark_object): Ignore Lisp_Misc_Free objects. Such objects may be freed markers which still exist on an undo list. --- src/alloc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/alloc.c b/src/alloc.c index b5a96953adb..dd4823bd9e3 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -844,7 +844,7 @@ lisp_align_free (block) free_ablock = ablock; /* Update busy count. */ ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY (abase)); - + if (2 > (long) ABLOCKS_BUSY (abase)) { /* All the blocks are free. */ int i = 0, aligned = (long) ABLOCKS_BUSY (abase); @@ -4976,6 +4976,15 @@ mark_object (arg) break; case Lisp_Misc: + if (XMISCTYPE (obj) == Lisp_Misc_Free) + { + /* This is (probably) a freed marker which may still exist on + a buffer undo list, so accept it here. */ + /* If we reuse the marker, and it still exists on the undo + list, and we do undo, behaviour is unpredictable -- + but at least we don't crash here. KFS 2004-05-17 */ + break; + } CHECK_ALLOCATED_AND_LIVE (live_misc_p); if (XMARKER (obj)->gcmarkbit) break; -- 2.39.5