bytecodealliance / bytecodealliance/wasmtime

Cranelift: panic with appropriate error when pointer width mismatches the platform word size

Open
#2,875 5 comments 0 reactions 0 assignees View on GitHub
bug cranelift
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

I'm not sure what causes this, so I'll stick to a generic title..

### `.clif` Test Case

```
function u0:1(i64 vmctx) {
gv0 = vmctx
heap0 = static gv0

block0(v3: i64):
v1 = iconst.i32 0
v2 = iadd v1, v1
store little v1, v2
return
}
```

### Steps to Reproduce

```
⋊> cargo run --manifest-path=cranelift/Cargo.toml -- compile --target=x86_64 /tmp/test.clif
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/clif-util compile --target=x86_64 /tmp/test.clif`
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `types::I32`,
right: `types::I64`', cranelift/codegen/src/isa/x64/lower.rs:1289:9
stack backtrace:
0: rust_begin_unwind
[...]
3: core::panicking::assert_failed
4: cranelift_codegen::isa::x64::lower::lower_to_amode
at ./cranelift/codegen/src/isa/x64/lower.rs:1289:9
5: cranelift_codegen::isa::x64::lower::lower_insn_to_regs
at ./cranelift/codegen/src/isa/x64/lower.rs:4805:21
6: cranelift_codegen::isa::x64::lower::::lower
at ./cranelift/codegen/src/isa/x64/lower.rs:5755:9
7: cranelift_codegen::machinst::lower::Lower::lower_clif_block
at ./cranelift/codegen/src/machinst/lower.rs:736:17
8: cranelift_codegen::machinst::lower::Lower::lower
at ./cranelift/codegen/src/machinst/lower.rs:973:17
9: cranelift_codegen::machinst::compile::compile
at ./cranelift/codegen/src/machinst/compile.rs:30:9
10: cranelift_codegen::isa::x64::X64Backend::compile_vcode
at ./cranelift/codegen/src/isa/x64/mod.rs:50:9
11: ::compile_function
at ./cranelift/codegen/src/isa/x64/mod.rs:61:21
12: cranelift_codegen::context::Context::compile
at ./cranelift/codegen/src/context.rs:197:26
13: cranelift_codegen::context::Context::compile_and_emit
at ./cranelift/codegen/src/context.rs:137:20
14: clif_util::compile::handle_module
at ./cranelift/src/compile.rs:81:29
15: clif_util::compile::run
at ./cranelift/src/compile.rs:52:9
16: clif_util::main
at ./cranelift/src/clif-util.rs:130:33
```

### Versions and Environment

Cranelift version or commit: `0.73.0` and current main

Operating system: Linux

Architecture: x86_64

### Extra Info

A quick `git bisect` takes me to cb48ea406eea535b3108853b7b680d9aa21eb14b. That's probably not too useful though.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.