check if length of code section equals of length of function type section
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user