afonso360 opened PR #5508 from fix-brtable
to main
:
:wave: Hey,
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.Fixes #5496
elliottt submitted PR review.
elliottt merged PR #5508.
Last updated: Dec 23 2024 at 12:05 UTC