diff options
-rw-r--r-- | src/intervals.c | 10 |
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; |