afonso360 opened PR #5167 from interp-heap-sat-sub
to main
:
:wave: Hey,
I don't know if we should merge this or not!
This PR started on https://github.com/bytecodealliance/wasmtime/pull/5155#discussion_r1009872167 where @jameysharp pointed out that it was a bit weird that the interpreter used a
saturating_sub
when calculatingheap_addr
sizes.I added that because we do have some 0 sized
heap_addr
's in runtests. However when fixing that, I added a verifier rule, and it turns out we have a lot of 0 sizedheap_addr
's in our test suite. Are these legal?The instruction docs state the following:
Verify that the offset range
p .. p + Size - 1
is in bounds for the heap H, and generate an absolute address that is safe to dereference.So it sounds like
Size
must always be larger than 1?But it also says:
If
p + Size
is not greater than the heap boundWhich would allow 0 as a
Size
.So, lets make a decision about this! I don't have any preference for either, I'm just opening this as a PR because when I started fixing the interpreter I thought it would just be that one runtest that was wrong!
Also, there are some regressions in the x64 codegen that probably shouldn't be there.
afonso360 updated PR #5167 from interp-heap-sat-sub
to main
.
afonso360 updated PR #5167 from interp-heap-sat-sub
to main
.
jameysharp requested cfallin for a review on PR #5167.
afonso360 updated PR #5167 from interp-heap-sat-sub
to main
.
Last updated: Nov 22 2024 at 16:03 UTC