summaryrefslogtreecommitdiff
path: root/src/marker.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/marker.c')
-rw-r--r--src/marker.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/marker.c b/src/marker.c
index 6a7652c8ce9..d054ef91e79 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;
}