mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 15:31: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:
@ -15,8 +15,8 @@
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $std/gc-object/obj (mut i32) (i32.const 0))
|
||||
(global $~started (mut i32) (i32.const 0))
|
||||
(table 3 3 anyfunc)
|
||||
(elem (i32.const 0) $~lib/collector/itcm/__gc_mark $std/gc-object/Custom~gc $std/gc-object/Base~gc)
|
||||
(table 4 4 anyfunc)
|
||||
(elem (i32.const 0) $null $~lib/collector/itcm/__gc_mark $std/gc-object/Custom~gc $std/gc-object/Base~gc)
|
||||
(memory $0 0)
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
@ -434,7 +434,7 @@
|
||||
(i32.const 24)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
(call $~lib/collector/itcm/ManagedObject#set:color
|
||||
(get_local $0)
|
||||
@ -469,7 +469,7 @@
|
||||
)
|
||||
(call_indirect (type $iv)
|
||||
(get_local $0)
|
||||
(i32.const 2)
|
||||
(i32.const 3)
|
||||
)
|
||||
(call $~lib/collector/itcm/__gc_mark
|
||||
(i32.load
|
||||
@ -567,10 +567,13 @@
|
||||
)
|
||||
(call $~lib/gc/gc.collect)
|
||||
)
|
||||
(func $~iterateRoots (; 19 ;) (; has Stack IR ;) (type $FUNCSIG$v)
|
||||
(func $null (; 19 ;) (; has Stack IR ;) (type $v)
|
||||
(nop)
|
||||
)
|
||||
(func $~iterateRoots (; 20 ;) (; has Stack IR ;) (type $FUNCSIG$v)
|
||||
(call_indirect (type $iv)
|
||||
(get_global $std/gc-object/obj)
|
||||
(i32.const 0)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user