Skip to content

Conversation

@stevenfontanella
Copy link
Member

@stevenfontanella stevenfontanella commented Dec 3, 2025

  • At instantiation time, check the types of exports against their corresponding imports, and trap if they don't match.
    • Exported memories and tables must be a subtype of the corresponding import.
    • Function types aren't checked yet because we don't have a way to check the exact type of function re-exports; i.e. exact-func-imports.wast would fail to instantiate on line 85.
  • Copy exact-func-import.wast from the testsuite repo, which now passes.
  • Fix ref_func.wast and tags.wast which also otherwise fail with the new validations.
  • Fix getMemoryInstanceInfo to follow import chains rather than just one import.
  • Also fix getMemorySize to read the runtime page size from imports when applicable. This is necessary to keep track of page sizes correctly when we import a memory that's later grown e.g. in test/spec/imports.wast.
  • Fixes imports0, imports2, linking0, linking3 and partially fixes imports, imports3 and memory64.

As followups, we should improve the handling of the "spectest" module by implementing the implicit definition described by the spec, and we should add tracking for exact types of function re-exports so that we can enable import-time type checking for function types.

@stevenfontanella stevenfontanella changed the base branch from main to multithread December 4, 2025 00:39
@stevenfontanella stevenfontanella force-pushed the import-validation branch 2 times, most recently from 3920f0c to 766d753 Compare December 5, 2025 00:16
Base automatically changed from multithread to main December 5, 2025 21:10
@stevenfontanella stevenfontanella force-pushed the import-validation branch 5 times, most recently from 32967bb to 1f212af Compare December 10, 2025 02:50
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.

2 participants