bytecodealliance / bytecodealliance/wasmtime

Cranelift: Huge stack slot results in panic rather than an error returned from codegen

Open
#7,916 1 comment 1 reaction 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

### `.clif` Test Case

```
test compile
target x86_64

function u0:12() system_v {
ss0 = explicit_slot 1073741824
ss1 = explicit_slot 16
ss2 = explicit_slot 1073741824
ss3 = explicit_slot 16
ss4 = explicit_slot 48

block0:
v21 = stack_load.i8 ss3
trap user0
}
```

### Steps to Reproduce

* Compile above test.

### Expected Results

Returns an error from `compile_function`.

### Actual Results

Panics with `Offset in NominalSPOffset is greater than 2GB; should hit impl limit first: TryFromIntError(())`

### Versions and Environment

Cranelift version or commit: 0.104

Operating system: N/A

Architecture: x86_64

### Extra Info

Reported by @matthiaskrgr at https://github.com/rust-lang/rustc_codegen_cranelift/issues/1434

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.