diff options
author | Daniël van de Giessen <daniel@dvdgiessen.nl> | 2025-04-16 14:17:14 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-05-07 17:25:43 +1000 |
commit | aedaa405953f6fad29ecd5e16d10de126ecb1af2 (patch) | |
tree | b172b81ec1d0ebb44c6a412bc478ba9c78ff79fe | |
parent | 2b29b1b8f9dc7014c27d9df43ca0ebd3ccc86060 (diff) | |
download | micropython-aedaa405953f6fad29ecd5e16d10de126ecb1af2.tar.gz micropython-aedaa405953f6fad29ecd5e16d10de126ecb1af2.zip |
py/modthread: Initialize thread state nlr_top to NULL.
This ensures the check in MP_NLR_JUMP_HEAD works as expected and
nlr_jump_fail gets called so we get a bit better error message.
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
-rw-r--r-- | py/runtime.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/runtime.h b/py/runtime.h index 77cdd0e203..ffbc3972a3 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -165,6 +165,7 @@ static inline void mp_thread_init_state(mp_state_thread_t *ts, size_t stack_size ts->gc_lock_depth = 0; // There are no pending jump callbacks or exceptions yet + ts->nlr_top = NULL; ts->nlr_jump_callback_top = NULL; ts->mp_pending_exception = MP_OBJ_NULL; |