Files
wasmtime/cranelift/codegen
Afonso Bordado c9c7d4991c riscv64: Fix br-table segfault with zero sized jump tables (#5508)
We had a off-by-one bounds check error when checking if we should
jump to the default block in a br-table. Instead of always jumping
to the default block when we have a jump table with 0 targets we
would try to compute an offset past the end of the table.

This sometimes would not crash, but it would crash if the there was
no block after the br_table, thus adding a cold block would cause a
segfault.

The actual fix is quite simple, do not count the default block
as a jump table entry when computing the limits.

This commit also does a bunch of cleanup and adding some comments
to the br_table emission code.
2023-01-03 10:22:48 -08:00
..
2021-10-10 14:19:08 +02:00
2022-12-05 08:38:57 -06:00

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