aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bignum.c b/bignum.c
index f1d26ffd8a..c5154dbe13 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1055,10 +1055,12 @@ rb_big_neg(x)
VALUE x;
{
VALUE z = rb_big_clone(x);
- BDIGIT *ds = BDIGITS(z);
- long i = RBIGNUM(x)->len;
+ BDIGIT *ds;
+ long i;
if (!RBIGNUM(x)->sign) get2comp(z);
+ ds = BDIGITS(z);
+ i = RBIGNUM(x)->len;
while (i--) {
ds[i] = ~ds[i];
}