summaryrefslogtreecommitdiff
path: root/py/modthread.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-10-17 12:27:49 +1100
committerDamien George <damien@micropython.org>2023-10-18 09:18:23 +1100
commit3883f29485fad21105f6f965d56bfec842b8cfbb (patch)
tree9858f03d98f185ea7e8fcce0adaecb6da5da34cf /py/modthread.c
parente78471416bc77d5355e2181047e57f1e45d3654c (diff)
py/modthread: Initialise nlr_jump_callback_top on threads.
The main thread gets this because the thread state is in bss, but subsequent threads need this field to be initialised. Also added a note to mpstate.h to help avoid missing this in the future. Fixes issue #12695. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/modthread.c')
-rw-r--r--py/modthread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/modthread.c b/py/modthread.c
index 6b7547490..e4dcccd25 100644
--- a/py/modthread.c
+++ b/py/modthread.c
@@ -174,6 +174,7 @@ STATIC void *thread_entry(void *args_in) {
// The GC starts off unlocked on this thread.
ts.gc_lock_depth = 0;
+ ts.nlr_jump_callback_top = NULL;
ts.mp_pending_exception = MP_OBJ_NULL;
// set locals and globals from the calling context