ruby-changes:64993
From: Kenta <ko1@a...>
Date: Fri, 22 Jan 2021 14:14:30 +0900 (JST)
Subject: [ruby-changes:64993] 887a1bfbbc (master): [ruby/bigdecimal] Stop using GetVpValue in rb_big_convert_to_BigDecimal
https://git.ruby-lang.org/ruby.git/commit/?id=887a1bfbbc From 887a1bfbbc336cf4292d5489e7a7a234ad93478e Mon Sep 17 00:00:00 2001 From: Kenta Murata <mrkn@m...> Date: Sat, 9 Jan 2021 17:31:23 +0900 Subject: [ruby/bigdecimal] Stop using GetVpValue in rb_big_convert_to_BigDecimal https://github.com/ruby/bigdecimal/commit/034fd2b25e diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index bcc2b32..5821a0a 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -2791,7 +2791,10 @@ rb_big_convert_to_BigDecimal(VALUE val, RB_UNUSED_VAR(size_t digs), int raise_ex https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L2791 } #endif else { - Real *vp = GetVpValue(val, 1); + VALUE str = rb_big2str(val, 10); + Real *vp = VpCreateRbObject(RSTRING_LEN(str) + BASE_FIG + 1, + RSTRING_PTR(str), true); + RB_GC_GUARD(str); return check_exception(vp->obj); } } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/