You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiled WASM-module won't run in browsers, due to the fact that the generated IF statement states that a I32 value must be returned, but the inner block does not define a return type.
Compiled WASM-module translated to WAST:
(module
(type (;0;) (func (param i32)))
(type (;1;) (func (param i32)))
(type (;2;) (func (param i32) (result i32)))
(type (;3;) (func))
(import "imports" "printi" (func (;0;) (type 0)))
(import "imports" "printc" (func (;1;) (type 1)))
(func (;2;) (type 2) (param i32) (result i32)
get_local 0
i32.const 0
i32.eq
if i32 ;; label = @1
block ;; label = @2 ;; this block should also return an i32!
i32.const 0
return
end
else
get_local 0
i32.const 1
i32.eq
if i32 ;; label = @2
block ;; label = @3 ;; this block should also return an i32!
i32.const 1
return
end
else
block ;; label = @3 ;; this block should also return an i32!
get_local 0
i32.const 1
i32.sub
call 2
get_local 0
i32.const 2
i32.sub
call 2
i32.add
return
end
end
end)
(func (;3;) (type 3)
i32.const 14
call 2
call 0)
(memory (;0;) 1)
(start 3))
Error generated by wast2wasm:
test.wast:15:9: type stack size too small at if true branch. got 0, expected at least 1
return
^^^^^^
test.wast:24:11: type stack size too small at if true branch. got 0, expected at least 1
return
^^^^^^
test.wast:37:11: type stack size too small at if false branch. got 0, expected at least 1
return
^^^^^^
The text was updated successfully, but these errors were encountered:
In the following program (Fibonacci):
The compiled WASM-module won't run in browsers, due to the fact that the generated
IF
statement states that aI32
value must be returned, but the inner block does not define a return type.Compiled WASM-module translated to WAST:
Error generated by
wast2wasm
:The text was updated successfully, but these errors were encountered: