]> git.kaiwu.me - nginx.git/commitdiff
fix segfault if nginx was build with -O2 -fomit-frame-pointer,
authorIgor Sysoev <igor@sysoev.ru>
Mon, 29 Jan 2007 11:52:25 +0000 (11:52 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 29 Jan 2007 11:52:25 +0000 (11:52 +0000)
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

src/core/ngx_times.c

index be289dd141897b57dfd9e193da718a57413c9230..551e10258aa014ee12a5ae50158d5313abf35d66 100644 (file)
@@ -87,7 +87,7 @@ ngx_time_update(time_t sec, ngx_uint_t msec)
         return;
     }
 
-    if (slot == NGX_TIME_SLOTS) {
+    if (slot == NGX_TIME_SLOTS - 1) {
         slot = 0;
     } else {
         slot++;