fix table import initialization

This commit is contained in:
Ilya Rezvov
2025-01-15 17:01:21 -07:00
parent 001f4c92a9
commit 720c234df8
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -467,8 +467,9 @@ calcInstance (Store fs ts ms gs es ds) imps mod = do
tableAddr <- case idx of
ExternTable tableAddr -> return tableAddr
_ -> throwError "incompatible import type"
let TableInstance { t = TableType lim et' } = ts ! tableAddr
if limitMatch lim limit && et == et'
let TableInstance { t = TableType (Limit _ max) et', items } = ts ! tableAddr
len <- MVector.length <$> (liftIO $ readIORef items)
if limitMatch (Limit (fromIntegral len) max) limit && et == et'
then return idx
else throwError "incompatible import type"