afonso360 opened PR #4507 from switch-fix
to main
:
:wave: Hey,
In #4502 we discovered a bug in the switch api where it would emit
icmp_imm
's with types that were not able to fully represent the destination index.The fix for this is to extend the input type to a type suitable for representing the largest index possible.
We also remove a check preventing small types from being compared. This has been fixed in the x86 backend for a while.
CC: #4502
CC: @jameysharp @bjorn3
bjorn3 created PR review comment:
This is not a valid input IMHO. I don't think we should support cases larger than what the maximum value of the input (in this case 255 as it uses an i8). They can't be hit anyway.
bjorn3 submitted PR review.
afonso360 submitted PR review.
afonso360 created PR review comment:
Makes sense. I'll reject these inputs instead.
afonso360 submitted PR review.
afonso360 created PR review comment:
Wait, what about if we have something like this
setup!(1, [10, 0x4100_0000_00bf_d470,]);
We are able to hit one of the outputs, does it make sense to reject that as well?
afonso360 edited PR review comment.
afonso360 edited PR review comment.
bjorn3 submitted PR review.
bjorn3 created PR review comment:
I think so too. I think it should require all cases to be in bounds.
afonso360 updated PR #4507 from switch-fix
to main
.
afonso360 updated PR #4507 from switch-fix
to main
.
afonso360 edited PR #4507 from switch-fix
to main
:
:wave: Hey,
In #4502 we discovered a bug in the switch api where it would emit
icmp_imm
's with types that were not able to fully represent the destination index.We now reject these inputs. The index val must always have a type that is capable of addressing the entire range of inputs.
We also remove a check preventing small types from being compared. This has been fixed in the x86 backend for a while.
CC: #4502
CC: @jameysharp @bjorn3
bjorn3 submitted PR review.
jameysharp submitted PR review.
jameysharp merged PR #4507.
Last updated: Dec 23 2024 at 13:07 UTC