Skip inlining and emit a warning when trying to inline a function into itself

This commit is contained in:
dcodeIO
2018-07-14 18:01:19 +02:00
parent 3b0fd9aac2
commit 4b8500355a
12 changed files with 52 additions and 9 deletions

View File

@ -0,0 +1,9 @@
(module
(type $v (func))
(memory $0 0)
(export "foo" (func $inlining-recursive/foo))
(export "memory" (memory $0))
(func $inlining-recursive/foo (; 0 ;) (type $v)
(call $inlining-recursive/foo)
)
)

View File

@ -0,0 +1,4 @@
@inline
export function foo(): void {
foo();
}

View File

@ -0,0 +1,12 @@
(module
(type $v (func))
(global $HEAP_BASE i32 (i32.const 8))
(memory $0 0)
(export "foo" (func $inlining-recursive/foo))
(export "memory" (memory $0))
(func $inlining-recursive/foo (; 0 ;) (type $v)
(block $inlining-recursive/foo|inlined.0
(call $inlining-recursive/foo)
)
)
)