mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-20 02:11:31 +00:00
Always add a null function at table index zero
This allows function references (a table index internally) to be nullable
This commit is contained in:
@ -4,29 +4,29 @@
|
||||
(type $v (func))
|
||||
(type $i (func (result i32)))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(global $function-expression/f1 (mut i32) (i32.const 0))
|
||||
(global $function-expression/f1 (mut i32) (i32.const 1))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $function-expression/f2 (mut i32) (i32.const 1))
|
||||
(global $function-expression/f3 (mut i32) (i32.const 2))
|
||||
(global $function-expression/f4 (mut i32) (i32.const 3))
|
||||
(global $function-expression/f2 (mut i32) (i32.const 2))
|
||||
(global $function-expression/f3 (mut i32) (i32.const 3))
|
||||
(global $function-expression/f4 (mut i32) (i32.const 4))
|
||||
(global $HEAP_BASE i32 (i32.const 56))
|
||||
(table 4 4 anyfunc)
|
||||
(elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~someName|2 $start~anonymous|3)
|
||||
(table 5 5 anyfunc)
|
||||
(elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~someName|3 $start~anonymous|4)
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s\00")
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start~anonymous|0 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(get_local $0)
|
||||
)
|
||||
(func $start~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(get_local $0)
|
||||
)
|
||||
(func $start~someName|2 (; 3 ;) (type $v)
|
||||
(func $start~someName|3 (; 3 ;) (type $v)
|
||||
(nop)
|
||||
)
|
||||
(func $start~anonymous|3 (; 4 ;) (type $i) (result i32)
|
||||
(func $start~anonymous|4 (; 4 ;) (type $i) (result i32)
|
||||
(i32.const 1)
|
||||
)
|
||||
(func $start (; 5 ;) (type $v)
|
||||
@ -113,4 +113,6 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $null (; 6 ;) (type $v)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user