Validator: thread table limits through OnReturnCallIndirect#2744
Merged
sbc100 merged 1 commit intoMay 6, 2026
Conversation
`SharedValidator::OnCallIndirect` passes `table_type.limits` to `TypeChecker::OnCallIndirect`, which uses `is_64` to expect i64 vs i32 for the table-index operand. `OnReturnCallIndirect` doesn't, so under table64 plain `call_indirect` with an i64 index validates while the matching `return_call_indirect` rejects it with `expected [i32] but got [i64]`. Fix: mirror the signature. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7d5da6c to
f7d23a8
Compare
OnReturnCallIndirect
ggreif
added a commit
to caffeinelabs/motoko
that referenced
this pull request
May 6, 2026
`return_call_indirect` under `table64` rejects an i64 table-index in
upstream wabt, while the matching `call_indirect` accepts it — a
clean asymmetry in the validator. The patched wabt mirrors the
working `OnCallIndirect` plumbing in `OnReturnCallIndirect` (4 lines
+ a regression test). With the patch, our `tailcall` bench's
`return_call_indirect` sites validate clean and the temporary
`tailcall.valid.{ok,ret.ok}` files this PR introduced are no longer
needed — drop them.
Patch is fetched from the open upstream PR via `fetchpatch`. Drop
this overlay (and the two-line `__intentionallyOverridingVersion`
shim) once the fix lands and nixpkgs picks it up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sbc100
approved these changes
May 6, 2026
Member
|
Thanks! |
Contributor
Author
|
@sbc100 thanks for reviewing and merging! What is the schedule for 1.0.41? Any plans? It would be cool to have a release before the |
Member
|
I can do a release today |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SharedValidator::OnCallIndirectpassestable_type.limitstoTypeChecker::OnCallIndirect, which expects i64 vs i32 for the table-index based onis_64.OnReturnCallIndirectdoesn't — so undertable64, plaincall_indirectwith an i64 index validates, but the matchingreturn_call_indirectrejects it withexpected [i32] but got [i64].Mirrors the signature. Adds a
test/typecheck/regression for the negative case.