summaryrefslogtreecommitdiff
path: root/py/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/vm.c')
-rw-r--r--py/vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/vm.c b/py/vm.c
index 848a77a45..f9eb2692d 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -744,7 +744,7 @@ unwind_jump:;
assert(TOP());
mp_obj_t value = mp_iternext_allow_raise(TOP());
if (value == MP_OBJ_STOP_ITERATION) {
- --sp; // pop the exhausted iterator
+ sp -= 5; // pop the exhausted iterator
ip += ulab; // jump to after for-block
} else {
PUSH(value); // push the next iteration value
@@ -1294,7 +1294,7 @@ exception_handler:
const byte *ip = code_state->ip + 1;
DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward
code_state->ip = ip + ulab; // jump to after for-block
- code_state->sp -= 1; // pop the exhausted iterator
+ code_state->sp -= 5; // pop the exhausted iterator
goto outer_dispatch_loop; // continue with dispatch loop
} else if (*code_state->ip == MP_BC_YIELD_FROM) {
// StopIteration inside yield from call means return a value of