add return type for select

This commit is contained in:
Ilya Rezvov
2023-08-21 21:11:39 -06:00
parent d0403ad554
commit c044f3f556
7 changed files with 60 additions and 11 deletions
+2 -2
View File
@@ -368,7 +368,7 @@ instance Serialize (Instruction Natural) where
put (CallIndirect tableIdx typeIdx) = putWord8 0x11 >> putULEB128 typeIdx >> putULEB128 tableIdx
-- Parametric instructions
put Drop = putWord8 0x1A
put Select = putWord8 0x1B
put (Select _) = putWord8 0x1B
-- Variable instructions
put (GetLocal idx) = putWord8 0x20 >> putULEB128 idx
put (SetLocal idx) = putWord8 0x21 >> putULEB128 idx
@@ -569,7 +569,7 @@ instance Serialize (Instruction Natural) where
return $ CallIndirect tableIdx typeIdx
-- Parametric instructions
0x1A -> return $ Drop
0x1B -> return $ Select
0x1B -> return $ Select Nothing
-- Variable instructions
0x20 -> GetLocal <$> getULEB128 32
0x21 -> SetLocal <$> getULEB128 32