summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-28 15:26:03 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-28 15:26:03 +0000
commit95202681d44399310599bf5c04150480bd419c9f (patch)
tree30d83cdc96e36265b24db7b117fc33447da32404
parent25f9e2163debb42a17a9f222f11331955e64b6a7 (diff)
downloadruby-95202681d44399310599bf5c04150480bd419c9f.tar.gz
ruby-95202681d44399310599bf5c04150480bd419c9f.tar.xz
ruby-95202681d44399310599bf5c04150480bd419c9f.zip
* ext/zlib/zlib.c (zstream_run): previous change didn't resolve the
problem. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21861 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 9ae27a5cc..17016e3b2 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.
+
Wed Jan 28 22:51:12 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/zlib/zlib.c (zstream_run): desperately guard the variable.
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 9c6cf9495..ffc566197 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;