Skip to content

Commit

Permalink
Fix table64 addressing on 32-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Dec 16, 2024
1 parent f236dd8 commit ac7d9f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/cranelift/src/translate/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ impl TableData {
}

// Convert `index` to `addr_ty`.
if index_ty != addr_ty {
if addr_ty.bytes() > index_ty.bytes() {
index = pos.ins().uextend(addr_ty, index);
} else if addr_ty.bytes() < index_ty.bytes() {
index = pos.ins().ireduce(addr_ty, index);
}

// Add the table base address base
Expand Down

0 comments on commit ac7d9f9

Please sign in to comment.