Open
Description
when crossing function frames, the current throw logic copies the exception onto the operand stack.
if the frame doesn't have enough stack space, it overruns.
a possible fix: rewind function frames in the throw logic rather than using goto return_func
.
eg.
(module
(tag $e (param i32 i32 i32 i32 i32 i32 i32 i32))
(func $g
i32.const 1234
i32.const 1234
i32.const 1234
i32.const 1234
i32.const 1234
i32.const 1234
i32.const 1234
i32.const 1234
throw $e
)
(func $f ;; the throw logic would overrun when copying the exception to this frame
call $g
)
(func (export "main")
try
call $f
catch_all
end
)
)