py/vm: Fix popping of exception block in UNWIND_JUMP opcode.
Fixes issue #1812.
This commit is contained in:
parent
9e677114e4
commit
93bb7dffd2
2
py/vm.c
2
py/vm.c
|
@ -674,7 +674,7 @@ unwind_jump:;
|
|||
exc_sp--; // pop exception handler
|
||||
goto dispatch_loop; // run the exception handler
|
||||
}
|
||||
exc_sp--;
|
||||
POP_EXC_BLOCK();
|
||||
}
|
||||
ip = (const byte*)MP_OBJ_TO_PTR(POP()); // pop destination ip for jump
|
||||
if (unum != 0) {
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
# test continue within exception handler
|
||||
|
||||
def f():
|
||||
lst = [1, 2, 3]
|
||||
for x in lst:
|
||||
print('a', x)
|
||||
try:
|
||||
if x == 2:
|
||||
raise Exception
|
||||
except Exception:
|
||||
continue
|
||||
print('b', x)
|
||||
f()
|
Loading…
Reference in New Issue