diff options
| author | Eli Zaretskii | 2018-03-13 18:00:23 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2018-03-13 18:00:23 +0200 |
| commit | 3e39897cd03a10b5d1ac75a89f999943e3dad5c0 (patch) | |
| tree | 0b624704c5716c2efde5fd5eb421aab04b3acaff /src | |
| parent | e4b73abd3897a9291fc028f5ef33d6215c7e9de9 (diff) | |
| download | emacs-3e39897cd03a10b5d1ac75a89f999943e3dad5c0.tar.gz emacs-3e39897cd03a10b5d1ac75a89f999943e3dad5c0.zip | |
Avoid assertion violation under visual-order-cursor-movement
* src/xdisp.c (Fmove_point_visually): Don't let point exceed the
BEGV..ZV range. Signal Beginning of buffer error when there's a
before-string at BEGV. (Bug#30787)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index b003a2f9ccc..fb6729c36aa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -22430,6 +22430,11 @@ Value is the new character position of point. */) | |||
| 22430 | new_pos += (row->reversed_p ? -dir : dir); | 22430 | new_pos += (row->reversed_p ? -dir : dir); |
| 22431 | else | 22431 | else |
| 22432 | new_pos -= (row->reversed_p ? -dir : dir); | 22432 | new_pos -= (row->reversed_p ? -dir : dir); |
| 22433 | new_pos = clip_to_bounds (BEGV, new_pos, ZV); | ||
| 22434 | /* If we didn't move, we've hit BEGV or ZV, so we | ||
| 22435 | need to signal a suitable error. */ | ||
| 22436 | if (new_pos == PT) | ||
| 22437 | break; | ||
| 22433 | } | 22438 | } |
| 22434 | else if (BUFFERP (g->object)) | 22439 | else if (BUFFERP (g->object)) |
| 22435 | new_pos = g->charpos; | 22440 | new_pos = g->charpos; |