# HG changeset patch # User Kim F. Storm # Date 1084795682 0 # Node ID d3542bbadad7640f564f358e1783e1436d1c9724 # Parent e01abd0ad603e4a016e9e63bf44670d14b422d4a (mark_object): Ignore Lisp_Misc_Free objects. Such objects may be freed markers which still exist on an undo list. diff -r e01abd0ad603 -r d3542bbadad7 src/alloc.c --- a/src/alloc.c Mon May 17 12:07:43 2004 +0000 +++ b/src/alloc.c Mon May 17 12:08:02 2004 +0000 @@ -844,7 +844,7 @@ 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 @@ 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;