Files
wasmtime/cranelift/codegen
Chris Fallin 13c7846815 Cranelift: add a vreg limit check to correctly return an error on too-large inputs. (#4882)
Previously, Cranelift panicked (via a a panic in regalloc2) when the
virtual-register limit of 2M (2^21) was reached. This resulted in a
perplexing and unhelpful failure when the user provided a too-large
input (such as the Wasm module in #4865).

This PR adds an explicit check when allocating vregs that fails with a
"code too large" error when the limit is hit, producing output such as
(on the minimized testcase from #4865):

```
Error: failed to compile wasm function 3785 at offset 0xa3f3

Caused by:
    Compilation error: Code for function is too large
```

Fixes #4865.
2022-09-08 10:04:59 -07:00
..
2021-10-10 14:19:08 +02:00
2022-09-06 13:49:56 -05:00
2022-07-07 12:54:39 -07:00
2022-09-06 13:49:56 -05:00

This crate contains the core Cranelift code generator. It translates code from an intermediate representation into executable machine code.