implement table.copy

This commit is contained in:
Ilya Rezvov
2022-06-05 21:45:58 -06:00
parent f445340568
commit b2f001aea8
3 changed files with 20 additions and 4 deletions
+1 -1
View File
@@ -379,7 +379,7 @@ getInstrType (TableInit tableIdx elemIdx) = do
let elemType = elems !! fromIntegral elemIdx
when (elemType /= tableType) $ throwError (RefTypeMismatch tableType elemType)
return $ [I32, I32, I32] ==> empty
getInstrType (TableCopy fromIdx toIdx) = do
getInstrType (TableCopy toIdx fromIdx) = do
Ctx { tables } <- ask
let (from, to) = (fromIntegral fromIdx, fromIntegral toIdx)
when (length tables <= from) $ throwError (TableIndexOutOfRange fromIdx)