diff options
| author | Damien George <damien@micropython.org> | 2021-04-28 10:50:09 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-04-30 15:13:43 +1000 |
| commit | 7e549b6718e80136b03074765f1d4add209a21a5 (patch) | |
| tree | 8924933c5c093f9df7e5fbe96377a19902fbd33b | |
| parent | a41cd150be01adc59828ead26a01a9d9324773e1 (diff) | |
py/profile: Use mp_handle_pending() to raise pending exception.
If MICROPY_ENABLE_SCHEDULER is enabled then MP_STATE_VM(sched_state) must
be updated after handling the pending exception, which is done by the
mp_handle_pending() function.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | py/profile.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/py/profile.c b/py/profile.c index 9cf8c4b7b..e5fb35f0e 100644 --- a/py/profile.c +++ b/py/profile.c @@ -298,9 +298,7 @@ STATIC mp_obj_t mp_prof_callback_invoke(mp_obj_t callback, prof_callback_args_t mp_prof_is_executing = false; if (MP_STATE_VM(mp_pending_exception) != MP_OBJ_NULL) { - mp_obj_t obj = MP_STATE_VM(mp_pending_exception); - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(obj); + mp_handle_pending(true); } return top; } |
