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 []
|
elems <- getSection ElementSection getVec []
|
||||||
functions <- getSection CodeSection getVec []
|
functions <- getSection CodeSection getVec []
|
||||||
datas <- getSection DataSection getVec []
|
datas <- getSection DataSection getVec []
|
||||||
|
if length funcTypes /= length functions
|
||||||
|
then fail "function and code section have inconsistent lengths"
|
||||||
|
else return ()
|
||||||
return $ emptyModule {
|
return $ emptyModule {
|
||||||
types,
|
types,
|
||||||
imports,
|
imports,
|
||||||
|
|||||||
Reference in New Issue
Block a user