Stream: git-wasmtime

Topic: wasmtime / PR #5508 riscv64: Fix `br_table` segfault with...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 02 2023 at 00:06):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jan 03 2023 at 18:22):

elliottt submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 03 2023 at 18:22):

elliottt merged PR #5508.


Last updated: Nov 22 2024 at 16:03 UTC