From 04d05db27ec4a160dcb3d3ff2934184fef455dbf Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 25 May 2017 20:39:08 +1000 Subject: [PATCH] py/vm: Fix bug with unwind jump popping the iterator from a for loop. This patch fixes a regression introduced by 088740ecc40476fd0796a3ef6a68ee7c677eae64 --- py/vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py/vm.c b/py/vm.c index 9704bc15ac..5094e3e450 100644 --- a/py/vm.c +++ b/py/vm.c @@ -690,8 +690,7 @@ unwind_jump:; } ip = (const byte*)MP_OBJ_TO_PTR(POP()); // pop destination ip for jump if (unum != 0) { - // pop iter and iter_buf - sp--; + // pop the exhausted iterator sp -= MP_OBJ_ITER_BUF_NSLOTS; } DISPATCH_WITH_PEND_EXC_CHECK();