clasp icon indicating copy to clipboard operation
clasp copied to clipboard

gmp: overflow in mpz type

Open Bike opened this issue 3 years ago • 0 comments

Using ash with too big a count results in an abort from GMP, meaning the Clasp process dies. This happens because we still have clasp_shift using mpz_mul_2exp which does its own allocation rather than our own allocation, and has annoying error behavior.

If an integer is too big for us to actually represent, ideally we would signal some kind of storage-condition recoverable by dropping back to the REPL or what have you.

Example: (ash 1 most-positive-fixnum)

We should probably also signal a storage-condition for a positive bignum count. Right now we signal a simple error, which is better than crashing but not the best.

Bike avatar Jun 07 '22 16:06 Bike