fix call_indirect evaluation

This commit is contained in:
Ilya Rezvov
2018-04-09 21:41:17 -07:00
parent dac931b055
commit d055a4ff6d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -572,7 +572,7 @@ eval store FunctionInstance { funcType, moduleInstance, code = Function { localT
return $ Done ctx { stack = reverse res ++ (drop (length args) $ stack ctx) }
step ctx@EvalCtx{ stack = (VI32 v): rest } (CallIndirect typeIdx) = do
let funcType = funcTypes moduleInstance ! fromIntegral typeIdx
let TableInstance { elements } = tableInstances store ! (tableaddrs moduleInstance ! fromIntegral v)
let TableInstance { elements } = tableInstances store ! (tableaddrs moduleInstance ! 0)
let funcAddr = elements !? fromIntegral v
case funcAddr of
Just (Just addr) -> do
+1 -1
View File
@@ -34,7 +34,7 @@ compile file = do
main :: IO ()
main = do
files <- Directory.listDirectory "tests/samples"
let files = ["linking.wast"]
-- let files = ["linking.wast"]
scriptTestCases <- (`mapM` files) $ \file -> do
content <- LBS.readFile $ "tests/samples/" ++ file
let Right script = Parser.parseScript <$> Lexer.scanner content