aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-02 22:41:46 -0700
committerPaul Eggert2011-04-02 22:41:46 -0700
commitb895abced91e6dcedf6c580ea3e51befc5c757c1 (patch)
tree63e086d0c5092fb7ba73d4dd5816da4e9e8f14ca /src
parent6f076cc771577096ebebb0af50462c6d0a4c112e (diff)
downloademacs-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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/alloc.c4
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 @@
12011-04-03 Paul Eggert <eggert@cs.ucla.edu> 12011-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. */
5224static int mark_object_loop_halt; 5224static size_t mark_object_loop_halt;
5225 5225
5226static void 5226static void
5227mark_vectorlike (struct Lisp_Vector *ptr) 5227mark_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