Repository navigation
Check table imports against the supplied table's current limits - #550
Merged
Merged
Conversation
A table import accepted a supplied table below the declared minimum or with a looser maximum. Table and memory imports now share `Limits.satisfies` over the supplied entity's current type, and their errors name that type as `actual`. The spec-test runner passed `assert_trap` and `assert_unlinkable` when the module they expect to fail instantiated without error. Now both expectedly report as failed. The runner's host `table64` export is now i64-indexed.
MaxDesiatov
force-pushed
the
maxd/table-import-limits
branch
from
December 4, 2026 16:13
d2a19e7 to
764252b
Compare
`currentType` copied the declared type and overwrote its minimum with the current size, which produced a type that neither the module nor the entity declares, and `Limits.satisfies` then compared two `Limits` values that mean different things. Match with `limitsMatch`, which takes the demanded minimum and maximum, the supplied entity's current size and its declared maximum. The index type and the shared flag are compared at the call sites. The mismatch error still reports the size the entity has now, built only on the failure path.
kateinoigakukun
force-pushed
the
maxd/table-import-limits
branch
from
December 5, 2026 04:59
fb32a6c to
fef9b43
Compare
kateinoigakukun
enabled stacked auto-merge (squash)
December 5, 2026 05:15
kateinoigakukun
approved these changes
Dec 5, 2026
kateinoigakukun
added a commit
that referenced
this pull request
Dec 5, 2026
`memoryImportRefusesDifferentSharedFlag(supplied: true)` creates a shared memory, which needs mprotect-based bounds checking. That is unavailable under AddressSanitizer and on Windows, so `Memory(...)` throws before the import is checked. This broke `build-macos` (which runs `swift test --sanitize address`) and `build-windows` after #550. The `supplied: true` case now runs only where `SpectestTests.sharedMemorySupported`. The `supplied: false` case, which imports a non-shared memory as shared, runs everywhere.
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.
A table import accepted a supplied table below the declared minimum or with a looser maximum. Table and memory imports now share
Limits.satisfiesover the supplied entity's current type, and their errors name that type asactual. The spec-test runner passedassert_trapandassert_unlinkablewhen the module they expect to fail instantiated without error. Now both expectedly report as failed. The runner's hosttable64export is now i64-indexed.