summaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 536779bb4..425676d32 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1855,6 +1855,7 @@ rb_big_rshift(x, y)
VALUE z;
BDIGIT_DBL num = 0;
long i, j;
+ volatile VALUE save_x;
if (shift < 0) return rb_big_lshift(x, INT2FIX(-shift));
@@ -1865,7 +1866,7 @@ rb_big_rshift(x, y)
return INT2FIX(-1);
}
if (!RBIGNUM(x)->sign) {
- x = rb_big_clone(x);
+ save_x = x = rb_big_clone(x);
get2comp(x);
}
xds = BDIGITS(x);