Repository navigation
Commit 2e7895c
authored
CABI: trap on misaligned waitable-set.{wait,poll} ptr (#741)
unpack_event stored the two i32 event payloads at the guest-supplied `ptr`
through store, whose alignment and bounds checks are assertions rather than
traps. A misaligned or out-of-bounds `ptr` thus raised an AssertionError in
the reference interpreter instead of trapping, and the prose said nothing.
Trap unless `ptr` is 4-byte-aligned and `ptr + 8` is within memory, matching
the checks lower_flat_values applies to an out-param pointer and what
Wasmtime already does. Document this in CanonicalABI.md and the Explainer,
whose description of waitable-set.wait wrongly called `payload-addr`
8-byte-aligned: the payload is two contiguous i32s, so 4-byte alignment is
all the ABI requires.
Assisted-by: claude:claude-fable-5-1
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>1 parent 06c3fa8 commit 2e7895c
3 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4043 | 4043 | | |
4044 | 4044 | | |
4045 | 4045 | | |
| 4046 | + | |
| 4047 | + | |
4046 | 4048 | | |
4047 | 4049 | | |
4048 | 4050 | | |
4049 | 4051 | | |
| 4052 | + | |
| 4053 | + | |
| 4054 | + | |
4050 | 4055 | | |
4051 | 4056 | | |
4052 | 4057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1841 | 1841 | | |
1842 | 1842 | | |
1843 | 1843 | | |
1844 | | - | |
| 1844 | + | |
| 1845 | + | |
1845 | 1846 | | |
1846 | 1847 | | |
1847 | 1848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2329 | 2329 | | |
2330 | 2330 | | |
2331 | 2331 | | |
| 2332 | + | |
| 2333 | + | |
2332 | 2334 | | |
2333 | 2335 | | |
2334 | 2336 | | |
| |||
0 commit comments