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

ruby-changes:5641

From: wanabe <ko1@a...>
Date: Fri, 13 Jun 2008 17:22:31 +0900 (JST)
Subject: [ruby-changes:5641] Ruby:r17148 (trunk): * complex.c (string_to_c_internal): save and restore backref. fixed

wanabe	2008-06-13 17:22:13 +0900 (Fri, 13 Jun 2008)

  New Revision: 17148

  Modified files:
    trunk/ChangeLog
    trunk/complex.c

  Log:
    * complex.c (string_to_c_internal): save and restore backref. fixed [ruby-dev:34991]

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/complex.c?r1=17148&r2=17147&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17148&r2=17147&diff_format=u

Index: complex.c
===================================================================
--- complex.c	(revision 17147)
+++ complex.c	(revision 17148)
@@ -1153,8 +1153,10 @@
 	return rb_assoc_new(Qnil, self);
 
     {
-	VALUE m, sr, si, re, r, i;
+	VALUE m, sr, si, re, r, i, backref;
 
+	backref = rb_backref_get();
+	rb_match_busy(backref);
 	m = f_match(comp_pat1, s);
 	if (!NIL_P(m)) {
 	    sr = Qnil;
@@ -1170,8 +1172,10 @@
 	}
 	if (NIL_P(m)) {
 	    m = f_match(comp_pat2, s);
-	    if (NIL_P(m))
+	    if (NIL_P(m)) {
+		rb_backref_set(backref);
 		return rb_assoc_new(Qnil, self);
+	    }
 	    sr = f_aref(m, INT2FIX(1));
 	    if (NIL_P(f_aref(m, INT2FIX(2))))
 		si = Qnil;
@@ -1206,6 +1210,7 @@
 	    else
 		i = f_to_i(si);
 	}
+	rb_backref_set(backref);
 	return rb_assoc_new(rb_complex_new2(r, i), re);
     }
 }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 17147)
+++ ChangeLog	(revision 17148)
@@ -1,5 +1,10 @@
-Tue Jun 13 17:06:20 2008  wanabe  <s.wanabe@g...>
+Fri Jun 13 17:20:40 2008  wanabe  <s.wanabe@g...>
 
+	* complex.c (string_to_c_internal): save and restore backref.
+	  fixed [ruby-dev:34991]
+
+Fri Jun 13 17:06:20 2008  wanabe  <s.wanabe@g...>
+
 	* rational.c (string_to_r_internal): save and restore backref.
 	  fixed [ruby-dev:34990]
 

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

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