calculate module instance

This commit is contained in:
Ilya Rezvov
2018-03-07 14:40:19 -08:00
parent a073456a63
commit 1dab371720
3 changed files with 66 additions and 22 deletions
-8
View File
@@ -484,10 +484,6 @@ tablesShouldBeValid Module { imports, tables } =
then Valid
else InvalidTableType
isTableImport :: Import -> Bool
isTableImport Import { desc = ImportTable _ } = True
isTableImport _ = False
memoryShouldBeValid :: Validator
memoryShouldBeValid Module { imports, mems } =
let memImports = filter isMemImport imports in
@@ -500,10 +496,6 @@ memoryShouldBeValid Module { imports, mems } =
isValidLimit :: Limit -> ValidationResult
isValidLimit (Limit min max) = if min <= fromMaybe min max then Valid else InvalidMemoryLimit
isMemImport :: Import -> Bool
isMemImport Import { desc = ImportMemory _ } = True
isMemImport _ = False
globalsShouldBeValid :: Validator
globalsShouldBeValid m@Module { imports, globals } =
let ctx = ctxFromModule [] [] Nothing m in