Adds stricter enforcement of Table element validation. (#368)

This enforces all ElementSegment rules prior to creating a new module
engine. This allows flexibility and less errors inside that function.

This also uses interface as table element to pass tests with -race

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-03-16 15:48:46 +08:00
committed by GitHub
parent f69115ac3d
commit 20390a80b4
19 changed files with 1343 additions and 217 deletions

View File

@@ -66,7 +66,7 @@ type Runtime interface {
//
// While a Module is pre-validated, there are a few situations which can cause an error:
// * The Module name is already in use.
// * The Module has a table element initializer that uses an imported global offset that puts it out of range.
// * The Module has a table element initializer that resolves to an index outside the Table minimum size.
// * The Module has a start function, and it failed to execute.
//
// Note: The last value of RuntimeConfig.WithContext is used for any start function.