Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cast to uintmax_t *before* multiplying in space calculations
This ensures that all cases where the result actually does fit in a uintmax_t are correctly handled. Before, the multiplication could be performed in a smaller type, leading to an incorrect result or, worse, undefined behavior due to signed integer overflow. This fixes a test failure that was actually observed on an i686 Linux system.
- Loading branch information