fix mem arg parsing

This commit is contained in:
Ilya Rezvov
2018-02-19 18:48:50 -08:00
parent 6a7b82086a
commit 55a6b482ef
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -267,7 +267,7 @@ instance Serialize Index where
get = Index <$> getULEB128
instance Serialize MemArg where
put (MemArg offset align) = putULEB128 align >> putULEB128 offset
put (MemArg align offset) = putULEB128 align >> putULEB128 offset
get = MemArg <$> getULEB128 <*> getULEB128
instance Serialize Instruction where
+1 -1
View File
@@ -41,7 +41,7 @@ main = do
let Right mod = Parser.parseModule <$> Lexer.scanner content
let Right mod' = Binary.decodeModuleLazy $ Binary.dumpModuleLazy mod
return $ testCase ("Dump module to binary and parse back: " ++ file) $
assertBool "Module matched" $ mod == mod'
assertEqual "Module matched" mod mod'
defaultMain $ testGroup "tests" [
testGroup "Syntax parsing" syntaxTestCases,
testGroup "Binary format" binaryTestCases