Skip to content

Conversation

MustBastani
Copy link

Hi,

I noticed a bug in the integer type resolver when determining the bit width of signed integers.

For example, for a range like -140..=-44, it assigns 8 bits, even though an i8 can only store values in the range -128..=127.

The problematic line is primarily in:

std::cmp::max(bits_needed_min, bits_needed_max) + if min < 0 && max > 0 { 1 } else { 0 }

However, my pull request includes additional changes to address the various integer bit widths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant