mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
f69fe329a9
mrb_bint_copy was creating reference to destination then destroying it with mpz_init, causing copy to happen in orphaned memory. this made clone return 0 instead of copying the bigint value. fix extracts common mpz_t-to-rbigint transfer logic into bint_set helper, used by both bint_new and mrb_bint_copy. eliminates code duplication and properly copies source data to destination rbigint structure, handling both embedded and heap storage cases. Co-authored-by: Claude <noreply@anthropic.com>