Skip to content

Fix CALL_INDIRECT cross-module type index resolution (#88)#90

Draft
andreaTP wants to merge 1 commit into
bytecodealliance:mainfrom
andreaTP:fix/call-indirect-cross-module-type-index
Draft

Fix CALL_INDIRECT cross-module type index resolution (#88)#90
andreaTP wants to merge 1 commit into
bytecodealliance:mainfrom
andreaTP:fix/call-indirect-cross-module-type-index

Conversation

@andreaTP

Copy link
Copy Markdown
Contributor

Fix #88

Type indices are module-local, so CALL_INDIRECT must resolve the caller's type index against the caller's own type section — not the callee's. For same-module calls, nominal type-index comparison is preserved (required for GC subtyping). For cross-module calls, structural FunctionType comparison is used via a new FunctionType.matches() utility.

…e#88)

Type indices are module-local, so CALL_INDIRECT must resolve the
caller's type index against the caller's own type section — not the
callee's. For same-module calls, nominal type-index comparison is
preserved (required for GC subtyping). For cross-module calls,
structural FunctionType comparison is used via a new
FunctionType.matches() utility.
@andreaTP andreaTP force-pushed the fix/call-indirect-cross-module-type-index branch from 2dccab9 to 622659b Compare July 13, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CALL_INDIRECT resolves caller type indices against the referenced function's module

1 participant