assemblyscript/tests/compiler/new-without-allocator.optimized.wat
dcodeIO 16d1a833dd Always add a null function at table index zero
This allows function references (a table index internally) to be nullable
2018-09-17 01:48:35 +02:00

21 lines
525 B
Plaintext

(module
(type $i (func (result i32)))
(type $v (func))
(type $FUNCSIG$i (func (result i32)))
(memory $0 0)
(export "memory" (memory $0))
(export "test" (func $new-without-allocator/test))
(func $~lib/memory/memory.allocate (; 0 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32)
(unreachable)
)
(func $new-without-allocator/test (; 1 ;) (; has Stack IR ;) (type $i) (result i32)
(drop
(call $~lib/memory/memory.allocate)
)
(i32.const 3)
)
(func $null (; 2 ;) (; has Stack IR ;) (type $v)
(nop)
)
)