fix reexports

This commit is contained in:
Ilya Rezvov
2023-08-21 21:15:53 -06:00
parent f23dc20d57
commit bb2a6cea7f
4 changed files with 19 additions and 10 deletions
+3 -2
View File
@@ -423,8 +423,9 @@ calcInstance (Store fs ts ms gs es ds) imps mod = do
memAddr <- case idx of
ExternMemory memAddr -> return memAddr
_ -> throwError "incompatible import type"
let MemoryInstance { lim } = ms ! memAddr
if limitMatch lim limit
let MemoryInstance { lim = Limit _ limMax, memory = mem } = ms ! memAddr
size <- liftIO $ (`quot` pageSize) <$> (readIORef mem >>= ByteArray.getSizeofMutableByteArray)
if limitMatch (Limit (fromIntegral size) limMax) limit
then return idx
else throwError "incompatible import type"
checkImportType imp@(Import _ _ (ImportTable (TableType limit et))) = do