Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 2002 20:28:45 -0701
From:      Jos Backus <jos@catnook.com>
To:        rsync@lists.samba.org
Cc:        cvs-all@FreeBSD.ORG
Subject:   Re: rsync breaks on FreeBSD without -O2?(fwd from grog@FreeBSD.org) PR 36998
Message-ID:  <20020421032907.GB23136@lizzy.catnook.com>
In-Reply-To: <20020421032505.GA23136@lizzy.catnook.com>
References:  <20020420193712.O10865@va.samba.org> <20020421032505.GA23136@lizzy.catnook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 20, 2002 at 08:24:43PM -0701, Jos Backus wrote:
> Here's some mail from freebsd-cvs-all
> (<20020420171059.A593@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@catnook.com     _/_/   _/_/_/            use Std::Disclaimer;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020421032907.GB23136>