summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-12 15:09:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-12 15:09:50 +0000
commitb525710be4dbfe8f725410787d977e97b103393e (patch)
tree3e6ea625deb823481c2ec16ed969ff9d02bfe945 /sprintf.c
parentf58c42d35776b2818474b59cbe109d180705b56d (diff)
* sprintf.c (rb_str_format): fix a GC problem.
[ruby-dev:28001] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index 9746d189e1..5e85d9522f 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -454,6 +454,7 @@ rb_f_sprintf(argc, argv)
int base, bignum = 0;
int len, pos;
VALUE tmp;
+ volatile VALUE tmp1;
switch (*p) {
case 'd':
@@ -602,7 +603,7 @@ rb_f_sprintf(argc, argv)
val = rb_big_clone(val);
rb_big_2comp(val);
}
- tmp = rb_big2str(val, base);
+ tmp1 = tmp = rb_big2str(val, base);
s = RSTRING(tmp)->ptr;
if (*s == '-') {
if (base == 10) {