File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,11 @@ module Language.Wasm.Interpreter (
10
10
ExternalValue (.. ),
11
11
ExportInstance (.. ),
12
12
GlobalInstance (.. ),
13
+ MemoryInstance (.. ),
14
+ MemoryStore ,
13
15
Imports ,
14
- HostItem (.. ),
16
+ HostItem (.. ),
17
+ Address ,
15
18
instantiate ,
16
19
invoke ,
17
20
invokeExport ,
@@ -20,7 +23,8 @@ module Language.Wasm.Interpreter (
20
23
emptyImports ,
21
24
makeHostModule ,
22
25
makeMutGlobal ,
23
- makeConstGlobal
26
+ makeConstGlobal ,
27
+ getMemory
24
28
) where
25
29
26
30
import qualified Data.Map as Map
@@ -1206,4 +1210,9 @@ getGlobalValueByName store ModuleInstance { exports } name =
1206
1210
case globalInst of
1207
1211
GIConst _ v -> return v
1208
1212
GIMut _ ref -> readIORef ref
1209
- _ -> error $ " Function with name " ++ show name ++ " was not found in module's exports"
1213
+ _ -> error $ " Function with name " ++ show name ++ " was not found in module's exports"
1214
+
1215
+ -- | Retrieve mutable memory from the 'Store'
1216
+ getMemory :: Store -> Address -> Maybe MemoryInstance
1217
+ getMemory Store {memInstances} address = memInstances !? address
1218
+
Original file line number Diff line number Diff line change 1
1
cabal-version : 2.2
2
2
name : wasm
3
- version : 1.1.1
3
+ version : 1.1.2
4
4
synopsis : WebAssembly Language Toolkit and Interpreter
5
5
description :
6
6
Library for parsing and interpreting WebAssembly, including :
@@ -64,7 +64,7 @@ library
64
64
, ieee754 >= 0.8 && < 0.9
65
65
, mtl >= 2.2.1 && < 2.3
66
66
, primitive >= 0.7 && < 0.8
67
- , text >= 1.1 && < 1. 3
67
+ , text >= 1.1 && < 3
68
68
, transformers >= 0.4 && < 0.6
69
69
, utf8-string >= 1.0 && < 1.1
70
70
, vector >= 0.12 && < 0.13
You can’t perform that action at this time.
0 commit comments