summaryrefslogtreecommitdiff
path: root/ext/bigdecimal
diff options
context:
space:
mode:
authorKenta Murata <mrkn@mrkn.jp>2021-01-09 17:31:23 +0900
committerKenta Murata <mrkn@mrkn.jp>2021-01-22 13:59:04 +0900
commit887a1bfbbc336cf4292d5489e7a7a234ad93478e (patch)
tree5e1ffbd17cda1a2d9d704905a743f23939b7ceca /ext/bigdecimal
parentfff1edf23ba28267bf57097c269f7fa87530e3fa (diff)
[ruby/bigdecimal] Stop using GetVpValue in rb_big_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/034fd2b25e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r--ext/bigdecimal/bigdecimal.c5
1 files changed, 4 insertions, 1 deletions
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
}
#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);
}
}