1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* rational.c (string_to_r_internal): save and restore backref. fixed [ruby-dev:34990]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
wanabe 2008-06-13 08:16:12 +00:00
parent 26f26890aa
commit 01d7152157
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Jun 13 17:06:20 2008 wanabe <s.wanabe@gmail.com>
* rational.c (string_to_r_internal): save and restore backref.
fixed [ruby-dev:34990]
Fri Jun 13 14:41:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* README.EXT.ja: update about Fixnum. reported in

View file

@ -1274,13 +1274,15 @@ make_patterns(void)
static VALUE
string_to_r_internal(VALUE self)
{
VALUE s, m;
VALUE s, m, backref;
s = f_strip(self);
if (RSTRING_LEN(s) == 0)
return rb_assoc_new(Qnil, self);
backref = rb_backref_get();
rb_match_busy(backref);
m = f_match(rat_pat, s);
if (!NIL_P(m)) {
@ -1333,8 +1335,10 @@ string_to_r_internal(VALUE self)
if (!NIL_P(de))
v = f_div(v, f_to_i(de));
rb_backref_set(backref);
return rb_assoc_new(v, re);
}
rb_backref_set(backref);
return rb_assoc_new(Qnil, self);
}