diff options
| author | Paul Eggert | 2011-04-20 01:30:52 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-20 01:30:52 -0700 |
| commit | 37aa2f85254069b9344f620ab5cd306e4aa33271 (patch) | |
| tree | c64d3d3ae717be20b667d48c6eb710e5b2323fe9 | |
| parent | c20db43fef1bceb545b05bec2dbf18b1fbb2b533 (diff) | |
| download | emacs-37aa2f85254069b9344f620ab5cd306e4aa33271.tar.gz emacs-37aa2f85254069b9344f620ab5cd306e4aa33271.zip | |
* intervals.c (offset_intervals): Tell GCC not to worry about length overflow
when negating a negative length.
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/intervals.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9a8177bf43f..d01d8fbd727 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed. | 6 | (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed. |
| 7 | * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT. | 7 | * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT. |
| 8 | All uses changed. | 8 | All uses changed. |
| 9 | (offset_intervals): Tell GCC not to worry about length overflow | ||
| 10 | when negating a negative length. | ||
| 9 | 11 | ||
| 10 | * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static. | 12 | * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static. |
| 11 | (overrun_check_free): Likewise. | 13 | (overrun_check_free): Likewise. |
diff --git a/src/intervals.c b/src/intervals.c index 8f3840976d0..e72bc146d16 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -39,6 +39,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 39 | 39 | ||
| 40 | #include <config.h> | 40 | #include <config.h> |
| 41 | #include <setjmp.h> | 41 | #include <setjmp.h> |
| 42 | #include <intprops.h> | ||
| 42 | #include "lisp.h" | 43 | #include "lisp.h" |
| 43 | #include "intervals.h" | 44 | #include "intervals.h" |
| 44 | #include "buffer.h" | 45 | #include "buffer.h" |
| @@ -1435,7 +1436,10 @@ offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) | |||
| 1435 | if (length > 0) | 1436 | if (length > 0) |
| 1436 | adjust_intervals_for_insertion (BUF_INTERVALS (buffer), start, length); | 1437 | adjust_intervals_for_insertion (BUF_INTERVALS (buffer), start, length); |
| 1437 | else | 1438 | else |
| 1438 | adjust_intervals_for_deletion (buffer, start, -length); | 1439 | { |
| 1440 | IF_LINT (if (length < - TYPE_MAXIMUM (EMACS_INT)) abort ();) | ||
| 1441 | adjust_intervals_for_deletion (buffer, start, -length); | ||
| 1442 | } | ||
| 1439 | } | 1443 | } |
| 1440 | 1444 | ||
| 1441 | /* Merge interval I with its lexicographic successor. The resulting | 1445 | /* Merge interval I with its lexicographic successor. The resulting |