Skip to content

Commit c0252d7

Browse files
jeplerdpgeorge
authored andcommitted
py/parse: Fix missing nlr_pop call in complex path of binary_op_maybe.
Reproducer (needs to be run as one compilation unit): ans = (-1) ** 2.3 aa Fixes issue micropython#17815. Signed-off-by: Jeff Epler <[email protected]>
1 parent 658a2e3 commit c0252d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,13 +671,13 @@ static bool binary_op_maybe(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs, mp_ob
671671
nlr_buf_t nlr;
672672
if (nlr_push(&nlr) == 0) {
673673
mp_obj_t tmp = mp_binary_op(op, lhs, rhs);
674+
nlr_pop();
674675
#if MICROPY_PY_BUILTINS_COMPLEX
675676
if (mp_obj_is_type(tmp, &mp_type_complex)) {
676677
return false;
677678
}
678679
#endif
679680
*res = tmp;
680-
nlr_pop();
681681
return true;
682682
} else {
683683
return false;

0 commit comments

Comments
 (0)