Commit 62056764 authored by Jim Blandy's avatar Jim Blandy
Browse files

* intervals.c (set_point): Check for point out of bounds before

	checking for an empty interval tree.
parent 517b2e01
...@@ -1254,16 +1254,18 @@ set_point (position, buffer) ...@@ -1254,16 +1254,18 @@ set_point (position, buffer)
if (position == buffer->text.pt) if (position == buffer->text.pt)
return; 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)) if (NULL_INTERVAL_P (buffer->intervals))
{ {
buffer->text.pt = position; buffer->text.pt = position;
return; 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. */ /* Position Z is really one past the last char in the buffer. */
if (position == BUF_ZV (buffer)) if (position == BUF_ZV (buffer))
iposition = position - 1; iposition = position - 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment