bjorn3 opened PR #8422 from bjorn3:fix_switch_u128_handling
to bytecodealliance:main
:
Previously trying to branch on a i128 with a branch value larger than i64::MAX after truncating to u64 would result in the branch value incorrectly getting interpreted as a value with the upper 64 bits being 1 rather than 0.
Fixes https://github.com/rust-lang/rustc_codegen_cranelift/issues/1484
bjorn3 requested elliottt for a review on PR #8422.
bjorn3 requested wasmtime-compiler-reviewers for a review on PR #8422.
elliottt submitted PR review.
elliottt created PR review comment:
This assert/conversion combination is a little surprising. If
y
converts tou64
, doesn't that mean that there's a possibility that it would produce a negativei64
value?
bjorn3 submitted PR review.
bjorn3 created PR review comment:
A negative i64 here is fine as the value on which we are operating is at most a 64bit integer and thus no implicit sign extension of the immediate will be done by
icmp_imm
.
elliottt submitted PR review.
elliottt merged PR #8422.
Last updated: Dec 23 2024 at 13:07 UTC