diff --git a/ChangeLog b/ChangeLog index 622fc3c3bf..065dc035ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jun 28 12:26:53 2013 Tanaka Akira + + * bignum.c (rb_big_and): Allocate new bignum with same size to shorter + argument if it's high bits are zero. + Fri Jun 28 12:14:04 2013 Tanaka Akira * ext/socket/ipsocket.c (init_inetsock_internal): Don't use local diff --git a/bignum.c b/bignum.c index 6087d3a13b..2ec83b8077 100644 --- a/bignum.c +++ b/bignum.c @@ -4747,6 +4747,9 @@ rb_big_and(VALUE x, VALUE y) hibits1 = hibitsx; hibits2 = hibitsy; + if (!hibits1) + l2 = l1; + z = bignew(l2, 0); zds = BDIGITS(z);