summaryrefslogtreecommitdiff
path: root/py/parse.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2025-08-02 15:24:45 -0500
committerDamien George <damien@micropython.org>2025-08-03 08:29:28 +1000
commitc0252d73c6499cf8c09fa57e17f4b530315b0ee0 (patch)
treede29ba4ffbe0690cb558cf9db2a32677de3b8d5f /py/parse.c
parent658a2e3dbd0316204a13f2478d98ea3f8649f064 (diff)
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 #17815. Signed-off-by: Jeff Epler <jepler@gmail.com>
Diffstat (limited to 'py/parse.c')
-rw-r--r--py/parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/parse.c b/py/parse.c
index 91eea3e36..6260987b2 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -671,13 +671,13 @@ static bool binary_op_maybe(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs, mp_ob
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
mp_obj_t tmp = mp_binary_op(op, lhs, rhs);
+ nlr_pop();
#if MICROPY_PY_BUILTINS_COMPLEX
if (mp_obj_is_type(tmp, &mp_type_complex)) {
return false;
}
#endif
*res = tmp;
- nlr_pop();
return true;
} else {
return false;