summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1993-05-14 14:40:56 +0000
committerJim Blandy <jimb@redhat.com>1993-05-14 14:40:56 +0000
commit620567645f9c58fcbaf3e39b10ad39d6994769af (patch)
tree6c02152db4678cc1102b75ab665eb745156f18a8
parent517b2e01b32e18c6a2b842686197752e64d430d7 (diff)
downloademacs-620567645f9c58fcbaf3e39b10ad39d6994769af.tar.gz
emacs-620567645f9c58fcbaf3e39b10ad39d6994769af.tar.bz2
emacs-620567645f9c58fcbaf3e39b10ad39d6994769af.zip
* intervals.c (set_point): Check for point out of bounds before
checking for an empty interval tree.
-rw-r--r--src/intervals.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 5f4998789ad..f08d80cff07 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1254,16 +1254,18 @@ set_point (position, buffer)
if (position == buffer->text.pt)
return;
+ /* Check this now, before checking if the buffer has any intervals.
+ That way, we can catch conditions which break this sanity check
+ whether or not there are intervals in the buffer. */
+ if (position > BUF_Z (buffer) || position < BUF_BEG (buffer))
+ abort ();
+
if (NULL_INTERVAL_P (buffer->intervals))
{
buffer->text.pt = position;
return;
}
- /* Perhaps we should just change `position' to the limit. */
- if (position > BUF_Z (buffer) || position < BUF_BEG (buffer))
- abort ();
-
/* Position Z is really one past the last char in the buffer. */
if (position == BUF_ZV (buffer))
iposition = position - 1;