summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py/vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/vm.c b/py/vm.c
index 02f8bc88c..5a624e91f 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -658,7 +658,7 @@ unwind_jump:;
assert(exc_sp >= exc_stack);
if (MP_TAGPTR_TAG1(exc_sp->val_sp)) {
- if (exc_sp->handler > ip) {
+ if (exc_sp->handler >= ip) {
// Found a finally handler that isn't active; run it.
// Getting here the stack looks like:
// (..., X, dest_ip)
@@ -1079,7 +1079,7 @@ unwind_return:
// Search for and execute finally handlers that aren't already active
while (exc_sp >= exc_stack) {
if (MP_TAGPTR_TAG1(exc_sp->val_sp)) {
- if (exc_sp->handler > ip) {
+ if (exc_sp->handler >= ip) {
// Found a finally handler that isn't active; run it.
// Getting here the stack looks like:
// (..., X, [iter0, iter1, ...,] ret_val)