From bd8a739b0fff4f9ac790fad8332e9837aae68916 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 16 Nov 2004 14:54:49 +0000 Subject: * numeric.c (flo_divmod): protect float values from GC by assignment to local variables. [ruby-dev:24873] * string.c (str_mod_check): frozen check should be separated. [ruby-core:3742] * array.c (rb_ary_update): pedantic check to detect rb_ary_to_ary() to modify the receiver. [ruby-dev:24861] * string.c (rb_str_justify): typo fixed. [ruby-dev:24851] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index bbb279b7d..cb176fe96 100644 --- a/numeric.c +++ b/numeric.c @@ -730,7 +730,9 @@ flo_divmod(x, y) return rb_num_coerce_bin(x, y); } flodivmod(RFLOAT(x)->value, fy, &div, &mod); - return rb_assoc_new(rb_float_new(div), rb_float_new(mod)); + x = rb_float_new(div); + y = rb_float_new(mod); + return rb_assoc_new(x, y); } /* -- cgit