* bignum.c (rb_big2str0): prevent working clone from

GC. [exerb-dev:0578].  patched by MURASE Masamitsu
  <masamitsu.murase AT gmail.com> at [exerb-dev:0580]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@35325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-04-14 09:01:05 +00:00
parent 383ad6740e
commit 52cd11a305
2 changed files with 6 additions and 8 deletions

View file

@ -1,11 +1,8 @@
Tue Mar 6 12:03:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
Sat Apr 14 18:00:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/yaml/rubytypes.rb (Exception.yaml_new): fix bug that causes
YAML serialization problem for Exception.
Exception#initialize doesn't use visible instance variable for
the exception message, so call the method with the message.
patched by Jingwen Owen Ou <jingweno AT gmail.com>.
http://github.com/ruby/ruby/pull/41
* bignum.c (rb_big2str0): prevent working clone from
GC. [exerb-dev:0578]. patched by MURASE Masamitsu
<masamitsu.murase AT gmail.com> at [exerb-dev:0580]
Fri Mar 2 10:53:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>

View file

@ -772,7 +772,7 @@ rb_big2str0(x, base, trim)
int base;
int trim;
{
volatile VALUE t;
VALUE t;
BDIGIT *ds;
long i, j, hbase;
VALUE ss;
@ -847,6 +847,7 @@ rb_big2str0(x, base, trim)
if (trim && i == 0 && num == 0) break;
}
}
RB_GC_GUARD(t);
if (trim) {while (s[j] == '0') j++;}
i = RSTRING(ss)->len - j;
if (RBIGNUM(x)->sign) {