This commit is contained in:
dcode
2019-05-23 03:08:25 +02:00
parent d94b4fca50
commit 51fdf9db4f
182 changed files with 81381 additions and 95410 deletions

View File

@ -0,0 +1,26 @@
var binaryen = require("binaryen");
var mod = binaryen.parseText(`
(module
(global $ref (mut i32) (i32.const 1))
(func $test
(call $release
(block (result i32)
(global.get $ref)
(global.set $ref
(call $retain
(i32.const 2) (; some-expression-that-might-conflict-with-a-temp ;)
)
)
)
)
)
(func $retain (param i32) (result i32)
(local.get 0)
)
(func $release (param i32)
(nop)
)
)
`);
if (!mod.validate()) console.log(":-(");
else console.log(mod.emitText());