From b895abced91e6dcedf6c580ea3e51befc5c757c1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 2 Apr 2011 22:41:46 -0700 Subject: [PATCH] * 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. --- src/ChangeLog | 4 ++++ 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 @@ 2011-04-03 Paul Eggert + * 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. + * search.c (boyer_moore, wordify): Remove vars set but not used. (wordify): Omit three unnecessary tests. 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; links of a list, in mark_object. In debugging, the call to abort will hit a breakpoint. Normally this is zero and the check never goes off. */ -static int mark_object_loop_halt; +static size_t mark_object_loop_halt; static void mark_vectorlike (struct Lisp_Vector *ptr) @@ -5278,7 +5278,7 @@ mark_object (Lisp_Object arg) void *po; struct mem_node *m; #endif - int cdr_count = 0; + size_t cdr_count = 0; loop: -- 2.39.5