summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-15 10:16:41 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-15 10:16:41 +0000
commit4b29cccf57c44f112c4ee06f30962060a16ae0aa (patch)
treeb101b3d25db372a7a63a418bbec01d9c20af3565 /bignum.c
parentade91aca9fd5902e33496a1a3fd1994ca66259fe (diff)
* bignum.c (bigsub_int): add RB_GC_GUARD. This patch is made by
Makoto Kishimoto. fixes #4223 [ruby-dev:42907] * bignum.c (bigadd_int): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index 809b164ff7..9c289f7a8e 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1767,6 +1767,7 @@ bigsub_int(VALUE x, long y0)
if (xn == 1 && num < 0) {
RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
zds[0] = (BDIGIT)-num;
+ RB_GC_GUARD(x);
return bignorm(z);
}
zds[0] = BIGLO(num);
@@ -1793,6 +1794,7 @@ bigsub_int(VALUE x, long y0)
if (num < 0) {
z = bigsub(x, rb_int2big(y0));
}
+ RB_GC_GUARD(x);
return bignorm(z);
}
@@ -1845,6 +1847,7 @@ bigadd_int(VALUE x, long y)
while (i < zn) {
zds[i++] = 0;
}
+ RB_GC_GUARD(x);
return bignorm(z);
}