summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--sprintf.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 38af7da9f4..2e3992d7f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Dec 13 00:08:09 2005 Tanaka Akira <akr@m17n.org>
+
+ * sprintf.c (rb_str_format): fix a GC problem.
+ [ruby-dev:28001]
+
Mon Dec 12 15:51:22 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/openssl/test_ssl.rb (test_parallel): call GC.start to close
diff --git a/sprintf.c b/sprintf.c
index e8c0d36164..580a54ae8f 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -604,11 +604,12 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
}
}
else {
+ volatile VALUE tmp1;
if (!RBIGNUM(val)->sign) {
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) {