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

ruby-changes:5041

From: matz <ko1@a...>
Date: Thu, 22 May 2008 21:27:37 +0900 (JST)
Subject: [ruby-changes:5041] matz - Ruby:r16534 (ruby_1_8): * parse.y (top_local_setup): fixed memory leak bug based on a

matz	2008-05-22 21:27:13 +0900 (Thu, 22 May 2008)

  New Revision: 16534

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/parse.y

  Log:
    * parse.y (top_local_setup): fixed memory leak bug based on a
      patch from Roger Pack <rogerpack2005 at gmail.com> in
      [ruby-core:16610].

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16534&r2=16533&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/parse.y?r1=16534&r2=16533&diff_format=u

Index: ruby_1_8/parse.y
===================================================================
--- ruby_1_8/parse.y	(revision 16533)
+++ ruby_1_8/parse.y	(revision 16534)
@@ -5805,7 +5805,7 @@
 		    rb_mem_clear(vars+i, len-i);
 		}
 		else {
-		    *vars++ = (VALUE)ruby_scope;
+		    *vars++ = 0;
 		    rb_mem_clear(vars, len);
 		}
 		ruby_scope->local_vars = vars;
@@ -5821,6 +5821,7 @@
                if (!(ruby_scope->flags & SCOPE_CLONE))
                    xfree(ruby_scope->local_tbl);
 	    }
+            ruby_scope->local_vars[-1] = 0; /* no reference needed */
 	    ruby_scope->local_tbl = local_tbl();
 	}
     }
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 16533)
+++ ruby_1_8/ChangeLog	(revision 16534)
@@ -1,3 +1,9 @@
+Thu May 22 21:24:15 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* parse.y (top_local_setup): fixed memory leak bug based on a
+	  patch from Roger Pack <rogerpack2005 at gmail.com> in
+	  [ruby-core:16610].
+
 Thu May 22 14:20:54 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* array.c (flatten): check if reentered.  [ruby-dev:34798]

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

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