[前][次][番号順一覧][スレッド一覧]

ruby-changes:10317

From: usa <ko1@a...>
Date: Thu, 29 Jan 2009 00:26:19 +0900 (JST)
Subject: [ruby-changes:10317] Ruby:r21861 (trunk): * ext/zlib/zlib.c (zstream_run): previous change didn't resolve the

usa	2009-01-29 00:26:03 +0900 (Thu, 29 Jan 2009)

  New Revision: 21861

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21861

  Log:
    * ext/zlib/zlib.c (zstream_run): previous change didn't resolve the
      problem.

  Modified files:
    trunk/ChangeLog
    trunk/ext/zlib/zlib.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 21860)
+++ ChangeLog	(revision 21861)
@@ -1,3 +1,8 @@
+Thu Jan 29 00:24:48 2009  NAKAMURA Usaku  <usa@r...>
+
+	* ext/zlib/zlib.c (zstream_run): previous change didn't resolve the
+	  problem.
+
 Wed Jan 28 22:51:12 2009  NAKAMURA Usaku  <usa@r...>
 
 	* ext/zlib/zlib.c (zstream_run): desperately guard the variable.
Index: ext/zlib/zlib.c
===================================================================
--- ext/zlib/zlib.c	(revision 21860)
+++ ext/zlib/zlib.c	(revision 21861)
@@ -708,7 +708,7 @@
 	/* 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 @@
     }
 
     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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]