rsync breaks on FreeBSD without -O2?(fwd from grog@FreeBSD.org) PR 36998

Jos Backus jos at catnook.com
Sat Apr 20 20:30:01 EST 2002


On Sat, Apr 20, 2002 at 08:24:43PM -0701, Jos Backus wrote:
> Here's some mail from freebsd-cvs-all
> (<20020420171059.A593 at xor.obsecurity.org>). Bruce Evans submitted this
> workaround which has been incorporated into the FreeBSD tree. I think we
> should do the same. I can do the honors :-)

Index: zlib/infcodes.c
===================================================================
RCS file: /data/cvs/rsync/zlib/infcodes.c,v
retrieving revision 1.3
diff -u -r1.3 infcodes.c
--- zlib/infcodes.c	2002/03/12 01:14:58	1.3
+++ zlib/infcodes.c	2002/04/21 03:28:49
@@ -197,8 +197,13 @@
       c->mode = COPY;
     case COPY:          /* o: copying bytes in window, waiting for space */
       f = q - c->sub.copy.dist;
-      while (f < s->window)             /* modulo window size-"while" instead */
-        f += s->end - s->window;        /* of "if" handles invalid distances */
+      {
+      /* XXX work around a gcc bug. */
+      volatile inflate_blocks_statef *s1 = s;
+
+      while (f < s1->window)            /* modulo window size-"while" instead */
+        f += s1->end - s1->window;      /* of "if" handles invalid distances */
+      }
       while (c->len)
       {
         NEEDOUT

-- 
Jos Backus                 _/  _/_/_/        Santa Clara, CA
                          _/  _/   _/
                         _/  _/_/_/             
                    _/  _/  _/    _/
jos at catnook.com     _/_/   _/_/_/            use Std::Disclaimer;




More information about the rsync mailing list