check if length of code section equals of length of function type section

This commit is contained in:
Ilya Rezvov
2018-04-16 20:11:46 -07:00
parent b27a89cc17
commit b27ce14618
+3
View File
@@ -790,6 +790,9 @@ instance Serialize Module where
elems <- getSection ElementSection getVec []
functions <- getSection CodeSection getVec []
datas <- getSection DataSection getVec []
if length funcTypes /= length functions
then fail "function and code section have inconsistent lengths"
else return ()
return $ emptyModule {
types,
imports,