From 0754c46a89138d5ef204e571b4c2ca92d59fc93d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 2 Oct 2007 21:05:39 +0000 Subject: [PATCH] (Fmarker_buffer): Make test for odd case into a failure. --- src/marker.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/marker.c b/src/marker.c index a57dafa3f3..0c89f71d79 100644 --- a/src/marker.c +++ b/src/marker.c @@ -452,9 +452,12 @@ Returns nil if MARKER points into a dead buffer. */) if (XMARKER (marker)->buffer) { XSETBUFFER (buf, XMARKER (marker)->buffer); - /* Return marker's buffer only if it is not dead. */ - if (!NILP (XBUFFER (buf)->name)) - return buf; + /* If the buffer is dead, we're in trouble: the buffer pointer here + does not preserve the buffer from being GC'd (it's weak), so + markers have to be unlinked from their buffer as soon as the buffer + is killed. */ + eassert (!NILP (XBUFFER (buf)->name)); + return buf; } return Qnil; } -- 2.39.2