Skip to content

Commit

Permalink
Cranelift/x64 backend: improve pointer width assert. (bytecodeallianc…
Browse files Browse the repository at this point in the history
…e#10118)

This adds additional information as to what is wrong when this assert is encountered.
  • Loading branch information
iwanders committed Jan 28, 2025
1 parent 2a5c141 commit 681c8c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cranelift/codegen/src/isa/x64/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,12 @@ fn lower_to_amode(ctx: &mut Lower<Inst>, spec: InsnInput, offset: i32) -> Amode
// We now either have an add that we must materialize, or some other input; as well as the
// final offset.
if let Some(add) = matches_input(ctx, spec, Opcode::Iadd) {
debug_assert_eq!(ctx.output_ty(add, 0), types::I64);
let output_ty = ctx.output_ty(add, 0);
debug_assert_eq!(
output_ty,
types::I64,
"Address width of 64 expected, got {output_ty}"
);
let add_inputs = &[
InsnInput {
insn: add,
Expand Down

0 comments on commit 681c8c8

Please sign in to comment.