Fixes the value stack size of the catch handler. There were two (related) issues here:
The previous code used func_->locals.size() as soon as the function was available, but it hadn't processed the function's locals yet, so it was always empty. (This might not matter in practice, as it's only used by the "function-wide catch handler", which just rethrows.)
The previous code didn't take the function's locals into account when computing the value stack height (relative to the function frame) for a try-catch block. So, it would drop the locals when catching an exception.
Fixes the value stack size of the catch handler. There were two (related) issues here:
func_->locals.size()
as soon as the function was available, but it hadn't processed the function's locals yet, so it was always empty. (This might not matter in practice, as it's only used by the "function-wide catch handler", which just rethrows.)Closes #2476
(Split from #2470 )