implement load* and store* instructions

This commit is contained in:
Lachlan Sneff
2019-02-14 15:13:58 -08:00
parent 2572a0259b
commit 8827830aba
5 changed files with 811 additions and 132 deletions

View File

@ -34,19 +34,16 @@ fn test_read_module() {
(module
(type $t0 (func (param i32) (result i32)))
(type $t1 (func (result i32)))
(memory 1)
(func $foo (type $t0) (param i32) (result i32)
get_local 0
(if
(then
i32.const 42
set_local 0
)
(else
i32.const 24
set_local 0
)
)
get_local 0
i32.load offset=16
i32.const 1
memory.grow
drop
i32.const 0
i32.load offset=4
i32.add
))
"#;
let wasm = wat2wasm(wat).unwrap();