bigint.c (ucmp): fixed error with zero length zero value.
Big integers have two kind of zero values:
digits in `p` array are all zeros
length `sn` is zero
The old code crashed with the latter zero.
MODIFY
mrbgems/mruby-bigint/core/bigint.c
mrbgems/mruby-bigint/core/bigint.c
@@ -186,6 +186,7 @@ ucmp(mpz_t *y, mpz_t *x)
{
if (y->sz < x->sz) return -1;
if (y->sz > x->sz) return 1;
+ if (x->sz == 0) return 0;
for (size_t i=x->sz-1;; i--) {
mp_limb a = y->p[i];
mp_limb b = x->p[i];

bigint.c (ucmp): fixed error with zero length zero value.

Big integers have two kind of zero values:

- digits in `p` array are all zeros
- length `sn` is zero

The old code crashed with the latter zero.