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

ruby-changes:11079

From: nobu <ko1@a...>
Date: Sat, 28 Feb 2009 18:06:19 +0900 (JST)
Subject: [ruby-changes:11079] Ruby:r22674 (ruby_1_8): * eval.c (rb_eval): needs to guard intermediate string objects.

nobu	2009-02-28 18:05:59 +0900 (Sat, 28 Feb 2009)

  New Revision: 22674

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

  Log:
    * eval.c (rb_eval): needs to guard intermediate string objects.
      based on a patch from Brent Roman <brent AT mbari.org> at
      [ruby-core:22584].

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/eval.c

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 22673)
+++ ruby_1_8/ChangeLog	(revision 22674)
@@ -1,3 +1,9 @@
+Sat Feb 28 18:05:58 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* eval.c (rb_eval): needs to guard intermediate string objects.
+	  based on a patch from Brent Roman <brent AT mbari.org> a
+	  [ruby-core:22584].
+
 Fri Feb 27 17:45:25 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (file_load_ok): checks if regular file, except for the
Index: ruby_1_8/eval.c
===================================================================
--- ruby_1_8/eval.c	(revision 22673)
+++ ruby_1_8/eval.c	(revision 22674)
@@ -3934,11 +3934,13 @@
 	      case NODE_DREGX:
 		result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
 				    node->nd_cflag);
+		RB_GC_GUARD(str); /* ensure str is not GC'd in rb_reg_new */
 		break;
 	      case NODE_DREGX_ONCE:	/* regexp expand once */
 		result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
 				    node->nd_cflag);
 		nd_set_type(node, NODE_LIT);
+		RB_GC_GUARD(str); /* ensure str is not GC'd in rb_reg_new */
 		node->nd_lit = result;
 		break;
 	      case NODE_LIT:

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

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