mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
bigint.c (mpz_get_int): should work with zero (i.e. y->p == NULL).
This commit is contained in:
@@ -721,6 +721,11 @@ mpz_get_str(mrb_state *mrb, char *s, mrb_int sz, mrb_int base, mpz_t *x)
|
||||
static int
|
||||
mpz_get_int(mpz_t *y, mrb_int *v)
|
||||
{
|
||||
if (uzero(y)) {
|
||||
*v = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
mp_limb2 i = 0;
|
||||
mp_limb *d = y->p + y->sz;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user