diff options
| author | Paul Eggert | 2011-04-02 22:41:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-02 22:41:46 -0700 |
| commit | b895abced91e6dcedf6c580ea3e51befc5c757c1 (patch) | |
| tree | 63e086d0c5092fb7ba73d4dd5816da4e9e8f14ca | |
| parent | 6f076cc771577096ebebb0af50462c6d0a4c112e (diff) | |
| download | emacs-b895abced91e6dcedf6c580ea3e51befc5c757c1.tar.gz emacs-b895abced91e6dcedf6c580ea3e51befc5c757c1.zip | |
* alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
Otherwise, GCC 4.6.0 optimizes the loop check away since the check
can always succeed if overflow has undefined behavior.
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/alloc.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2c8a95c3571..62731238903 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2011-04-03 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-04-03 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int. | ||
| 4 | Otherwise, GCC 4.6.0 optimizes the loop check away since the check | ||
| 5 | can always succeed if overflow has undefined behavior. | ||
| 6 | |||
| 3 | * search.c (boyer_moore, wordify): Remove vars set but not used. | 7 | * search.c (boyer_moore, wordify): Remove vars set but not used. |
| 4 | (wordify): Omit three unnecessary tests. | 8 | (wordify): Omit three unnecessary tests. |
| 5 | 9 | ||
diff --git a/src/alloc.c b/src/alloc.c index 07f1caae46b..54c4760abab 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -5221,7 +5221,7 @@ int last_marked_index; | |||
| 5221 | links of a list, in mark_object. In debugging, | 5221 | links of a list, in mark_object. In debugging, |
| 5222 | the call to abort will hit a breakpoint. | 5222 | the call to abort will hit a breakpoint. |
| 5223 | Normally this is zero and the check never goes off. */ | 5223 | Normally this is zero and the check never goes off. */ |
| 5224 | static int mark_object_loop_halt; | 5224 | static size_t mark_object_loop_halt; |
| 5225 | 5225 | ||
| 5226 | static void | 5226 | static void |
| 5227 | mark_vectorlike (struct Lisp_Vector *ptr) | 5227 | mark_vectorlike (struct Lisp_Vector *ptr) |
| @@ -5278,7 +5278,7 @@ mark_object (Lisp_Object arg) | |||
| 5278 | void *po; | 5278 | void *po; |
| 5279 | struct mem_node *m; | 5279 | struct mem_node *m; |
| 5280 | #endif | 5280 | #endif |
| 5281 | int cdr_count = 0; | 5281 | size_t cdr_count = 0; |
| 5282 | 5282 | ||
| 5283 | loop: | 5283 | loop: |
| 5284 | 5284 | ||