mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-bigint (mrb_bint_2comp): need to initialize mpz_t
This commit is contained in:
@@ -1888,6 +1888,7 @@ mrb_bint_2comp(mrb_state *mrb, mrb_value x)
|
||||
mpz_t a, z;
|
||||
|
||||
bint_as_mpz(RBIGINT(x), &a);
|
||||
mpz_init(mrb, &z);
|
||||
mrb_assert(a.sn < 0);
|
||||
size_t size = a.sz;
|
||||
mpz_realloc(mrb, &z, size);
|
||||
|
||||
Reference in New Issue
Block a user