diff options
author | kris <kris@FreeBSD.org> | 2002-03-31 23:47:52 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2002-03-31 23:47:52 +0000 |
commit | d7a9079b763eba35cbcf4f8b7d1b8d52918ae4ed (patch) | |
tree | c3cd1b3715b7f1c0f89ede3a646554576b192c58 /lib/libz | |
parent | ef82a516346a59befd780764209cd79a53941758 (diff) | |
download | FreeBSD-src-d7a9079b763eba35cbcf4f8b7d1b8d52918ae4ed.zip FreeBSD-src-d7a9079b763eba35cbcf4f8b7d1b8d52918ae4ed.tar.gz |
Work around a gcc bug which causes zlib to dump core in certain
situations. This can be removed once gcc is fixed.
Submitted by: bde
Diffstat (limited to 'lib/libz')
-rw-r--r-- | lib/libz/infcodes.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libz/infcodes.c b/lib/libz/infcodes.c index 7c5073b..5ae69b5 100644 --- a/lib/libz/infcodes.c +++ b/lib/libz/infcodes.c @@ -200,8 +200,13 @@ int r; 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 |