fix table import initialization
This commit is contained in:
@@ -467,8 +467,9 @@ calcInstance (Store fs ts ms gs es ds) imps mod = do
|
|||||||
tableAddr <- case idx of
|
tableAddr <- case idx of
|
||||||
ExternTable tableAddr -> return tableAddr
|
ExternTable tableAddr -> return tableAddr
|
||||||
_ -> throwError "incompatible import type"
|
_ -> throwError "incompatible import type"
|
||||||
let TableInstance { t = TableType lim et' } = ts ! tableAddr
|
let TableInstance { t = TableType (Limit _ max) et', items } = ts ! tableAddr
|
||||||
if limitMatch lim limit && et == et'
|
len <- MVector.length <$> (liftIO $ readIORef items)
|
||||||
|
if limitMatch (Limit (fromIntegral len) max) limit && et == et'
|
||||||
then return idx
|
then return idx
|
||||||
else throwError "incompatible import type"
|
else throwError "incompatible import type"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ main = do
|
|||||||
files <-
|
files <-
|
||||||
filter (List.isSuffixOf ".wast")
|
filter (List.isSuffixOf ".wast")
|
||||||
<$> Directory.listDirectory "tests/spec"
|
<$> Directory.listDirectory "tests/spec"
|
||||||
-- let files = ["simd_i16x8_q15mulr_sat_s.wast"]
|
-- let files = ["table_grow.wast"]
|
||||||
scriptTestCases <- (`mapM` files) $ \file -> do
|
scriptTestCases <- (`mapM` files) $ \file -> do
|
||||||
test <- LBS.readFile ("tests/spec/" ++ file)
|
test <- LBS.readFile ("tests/spec/" ++ file)
|
||||||
return $ testCase file $ do
|
return $ testCase file $ do
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ library
|
|||||||
, happy:happy >=1.9.4 && < 1.21
|
, happy:happy >=1.9.4 && < 1.21
|
||||||
build-depends:
|
build-depends:
|
||||||
array >=0.5 && < 0.6
|
array >=0.5 && < 0.6
|
||||||
, base >=4.6 && < 5
|
, base >=4.11 && < 5
|
||||||
, bytestring >=0.10 && < 0.12
|
, bytestring >=0.10 && < 0.12
|
||||||
, cereal >=0.5 && < 0.6
|
, cereal >=0.5 && < 0.6
|
||||||
, containers >=0.5 && < 0.7
|
, containers >=0.5 && < 0.7
|
||||||
|
|||||||
Reference in New Issue
Block a user