commit be2bf991fa9224496f72815e4b3b1babe097c0f1
parent e61397d63ae24473496ec1e4a4193304722fd8a6
Author: William Casarin <jb55@jb55.com>
Date: Tue, 17 Aug 2021 08:55:23 -0700
don't error on extra values on stack on return
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/wasm.c b/src/wasm.c
@@ -3804,7 +3804,7 @@ static INLINE int drop_callframe_return(struct wasm_interp *interp, int returnin
if (returning) {
drop = cnt - frame->prev_stack_items -
func->functype->result.num_valtypes;
- if (drop < 0 ||
+ if (drop > 0 &&
!cursor_dropn(&interp->stack, sizeof(struct val), drop)) {
return interp_error(interp,
"error dropping extra stack values in return. "