From 00925ff256fdf96d3bb259464e771c553c1ffabb Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 28 Jun 2024 00:05:48 +0900 Subject: fix: handling of loop parameters --- src/Execution/Runtime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Execution/Runtime.php b/src/Execution/Runtime.php index 5b97be3..53a0e8d 100644 --- a/src/Execution/Runtime.php +++ b/src/Execution/Runtime.php @@ -2416,10 +2416,10 @@ final class Runtime $instrs = $instr->body; $f = $this->stack->currentFrame(); $bt = self::expandBlockType($blockType, $f->module); - $params = array_reverse($this->stack->popNValues(count($bt->params->types))); $m = count($bt->params->types); $l = new Label($m); while (true) { + $params = array_reverse($this->stack->popNValues($m)); $result = $this->execInstrs($instrs, $l, $params); if ($result === null) { return null; -- cgit v1.2.3-70-g09d2