# HG changeset patch # User Igor Sysoev # Date 1170071545 0 # Node ID a62d30719ea15eeb992e20847d62636d93204efd # Parent c7850d8b5239f05546711b8cd087ea8eca4bc56c fix segfault if nginx was build with -O2 -fomit-frame-pointer, r1082 did not fix the bug the bug lived for a long time but became apparent when nginx was built with gcc 4.0.x -O2 optimization diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c --- a/src/core/ngx_times.c +++ b/src/core/ngx_times.c @@ -87,7 +87,7 @@ ngx_time_update(time_t sec, ngx_uint_t m return; } - if (slot == NGX_TIME_SLOTS) { + if (slot == NGX_TIME_SLOTS - 1) { slot = 0; } else { slot++;