aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 1e7cb4ec665..7ff37a6fb48 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4999,6 +4999,14 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
4999 { 4999 {
5000 ptrdiff_t ovendpos = OVERLAY_POSITION (OVERLAY_END (overlay)); 5000 ptrdiff_t ovendpos = OVERLAY_POSITION (OVERLAY_END (overlay));
5001 5001
5002 /* Some borderly-sane Lisp might call us with the current
5003 buffer narrowed so that overlay-end is outside the
5004 POINT_MIN..POINT_MAX region, which will then cause
5005 various assertion violations and crashes down the road,
5006 starting with pop_it when it will attempt to use POSITION
5007 set below. Prevent that. */
5008 ovendpos = clip_to_bounds (BEGV, ovendpos, ZV);
5009
5002 if (ovendpos > CHARPOS (*position)) 5010 if (ovendpos > CHARPOS (*position))
5003 SET_TEXT_POS (*position, ovendpos, CHAR_TO_BYTE (ovendpos)); 5011 SET_TEXT_POS (*position, ovendpos, CHAR_TO_BYTE (ovendpos));
5004 } 5012 }