diff options
| author | Damien George <damien@micropython.org> | 2023-06-02 11:19:44 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-06-02 21:47:34 +1000 |
| commit | 24aa81e1da6385b636cbaef364ba2c67d977b7ec (patch) | |
| tree | 0e1c3e12cc3202b9a093e713f06f2cad3696954d /py | |
| parent | a61d40e5e80e33172b41961ee5dcad6fb9a1f4a9 (diff) | |
py/nlrsetjmp: Use MP_NLR_JUMP_HEAD macro to simplify code.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py')
| -rw-r--r-- | py/nlrsetjmp.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/py/nlrsetjmp.c b/py/nlrsetjmp.c index 960dd86f5..73fbe8126 100644 --- a/py/nlrsetjmp.c +++ b/py/nlrsetjmp.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * Copyright (c) 2013-2023 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,14 +29,7 @@ #if MICROPY_NLR_SETJMP void nlr_jump(void *val) { - nlr_buf_t **top_ptr = &MP_STATE_THREAD(nlr_top); - nlr_buf_t *top = *top_ptr; - if (top == NULL) { - nlr_jump_fail(val); - } - top->ret_val = val; - MP_NLR_RESTORE_PYSTACK(top); - *top_ptr = top->prev; + MP_NLR_JUMP_HEAD(val, top); longjmp(top->jmpbuf, 1); } |
