diff options
| author | Jim Blandy | 1993-05-14 14:40:56 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-05-14 14:40:56 +0000 |
| commit | 620567645f9c58fcbaf3e39b10ad39d6994769af (patch) | |
| tree | 6c02152db4678cc1102b75ab665eb745156f18a8 /src | |
| parent | 517b2e01b32e18c6a2b842686197752e64d430d7 (diff) | |
| download | emacs-620567645f9c58fcbaf3e39b10ad39d6994769af.tar.gz emacs-620567645f9c58fcbaf3e39b10ad39d6994769af.zip | |
* intervals.c (set_point): Check for point out of bounds before
checking for an empty interval tree.
Diffstat (limited to 'src')
| -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) | |||
| 1254 | if (position == buffer->text.pt) | 1254 | if (position == buffer->text.pt) |
| 1255 | return; | 1255 | return; |
| 1256 | 1256 | ||
| 1257 | /* Check this now, before checking if the buffer has any intervals. | ||
| 1258 | That way, we can catch conditions which break this sanity check | ||
| 1259 | whether or not there are intervals in the buffer. */ | ||
| 1260 | if (position > BUF_Z (buffer) || position < BUF_BEG (buffer)) | ||
| 1261 | abort (); | ||
| 1262 | |||
| 1257 | if (NULL_INTERVAL_P (buffer->intervals)) | 1263 | if (NULL_INTERVAL_P (buffer->intervals)) |
| 1258 | { | 1264 | { |
| 1259 | buffer->text.pt = position; | 1265 | buffer->text.pt = position; |
| 1260 | return; | 1266 | return; |
| 1261 | } | 1267 | } |
| 1262 | 1268 | ||
| 1263 | /* Perhaps we should just change `position' to the limit. */ | ||
| 1264 | if (position > BUF_Z (buffer) || position < BUF_BEG (buffer)) | ||
| 1265 | abort (); | ||
| 1266 | |||
| 1267 | /* Position Z is really one past the last char in the buffer. */ | 1269 | /* Position Z is really one past the last char in the buffer. */ |
| 1268 | if (position == BUF_ZV (buffer)) | 1270 | if (position == BUF_ZV (buffer)) |
| 1269 | iposition = position - 1; | 1271 | iposition = position - 1; |