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:
@ -11,9 +11,9 @@
|
||||
(global $builtins/u (mut i32) (i32.const 0))
|
||||
(global $builtins/U (mut i64) (i64.const 0))
|
||||
(global $builtins/s (mut i32) (i32.const 0))
|
||||
(global $builtins/fn (mut i32) (i32.const 0))
|
||||
(table 1 1 anyfunc)
|
||||
(elem (i32.const 0) $start~anonymous|0)
|
||||
(global $builtins/fn (mut i32) (i32.const 1))
|
||||
(table 2 2 anyfunc)
|
||||
(elem (i32.const 0) $builtins/test $start~anonymous|1)
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s")
|
||||
(data (i32.const 40) "\01\00\00\001")
|
||||
@ -21,7 +21,7 @@
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $builtins/test))
|
||||
(start $start)
|
||||
(func $start~anonymous|0 (; 1 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32)
|
||||
(func $start~anonymous|1 (; 1 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32)
|
||||
(nop)
|
||||
)
|
||||
(func $builtins/test (; 2 ;) (; has Stack IR ;) (type $v)
|
||||
|
Reference in New Issue
Block a user