summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-29 17:12:16 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-29 17:12:16 +0000
commitbd0ba009d1b28efe8c3a772540ad64635bb02edd (patch)
tree7d1f3e1893f9ff7f9ff0f90529845c3c3d163218
parent2ad225c2892a070bebb8a49547b4dc3bcf74d531 (diff)
merges r21861 from trunk into ruby_1_9_1.
* ext/zlib/zlib.c (zstream_run): previous change didn't resolve the problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/zlib/zlib.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ffc52f999..9507c98aef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jan 29 00:24:48 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/zlib/zlib.c (zstream_run): previous change didn't resolve the
+ problem.
+
Fri Jan 30 01:39:27 2009 Yusuke Endoh <mame@tsg.ne.jp>
* parse.y (top_compstmt, top_stmts, top_stmt): prohibit BEGIN {} in
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 9c6cf9495e..ffc566197c 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -708,7 +708,7 @@ zstream_run(struct zstream *z, Bytef *src, uInt len, int flush)
/* keep reference to `z->input' so as not to be garbage collected
after zstream_reset_input() and prevent `z->stream.next_in'
from dangling. */
- RB_GC_GUARD(guard) = z->input;
+ guard = z->input;
}
if (z->stream.avail_out == 0) {
@@ -716,6 +716,9 @@ zstream_run(struct zstream *z, Bytef *src, uInt len, int flush)
}
for (;;) {
+ /* VC allocates err and guard to same address. accessing err and guard
+ in same scope prevents it. */
+ RB_GC_GUARD(guard);
n = z->stream.avail_out;
err = z->func->run(&z->stream, flush);
z->buf_filled += n - z->stream.avail_out;