validate table.init and use mutable vector as a table storage

This commit is contained in:
Ilya Rezvov
2022-05-30 21:43:44 -06:00
parent 8c97e2c328
commit cbeb4bb61d
3 changed files with 62 additions and 37 deletions
+2 -1
View File
@@ -260,9 +260,10 @@ runScript onAssertFail script = do
st <- fst <$> State.get
(res, store') <- liftIO $ Interpreter.instantiate (store st) (buildImports st) m
case res of
Left failureString -> return ()
Left "Start function terminated with trap" ->
State.modify $ \(st, pos) -> (st { store = store' }, pos)
_ -> printFailedAssert ("Module linking should fail with trap during execution of a start function") assert
r -> printFailedAssert "Module linking should fail with trap during execution of a start function" assert
Left reason -> error $ "Module linking failed due to invalid module with reason: " ++ show reason
runAssert assert@(AssertExhaustion action failureString) = do
result <- runActionInAssert action