Background:
CFGStackify's fixEndsAtEndOfFunction fixes block/loop/try's return
type when the end of function is unreachable and the function return
type is not void. So if a function returns i32 and block-end wraps the
whole function, i.e., the block's end is the last instruction of the
function, the block's return type should be i32 too:
block i32 ... end end_function
If there are consecutive ends, this signature has to be propagate to
those blocks too, like:
block i32 ... block i32 ... end end end_function
This applies to try-end too:
try i32 ... catch ... end end_function
In case of try, we not only follow consecutive ends but also follow
catch, because for the type of the whole try to be i32, both try
and catch parts have to be i32:
try i32 ... block i32 ... end catch ... block i32 ... end end end_function
Previously we only handled consecutive ends or end before a catch.
But now we have delegate, which serves like end for
try-delegate. So we have to follow delegate too and mark its
corresponding try as i32 (the function's return type):
try i32 ... catch ... try i32 ;; Here ... delegate N end end_function