Merge pull request #5152 from microDev1/traceback
Fix crash on raise of reload exception
This commit is contained in:
commit
6e885c8610
@ -146,6 +146,8 @@ typedef struct _mp_state_vm_t {
|
|||||||
|
|
||||||
// exception object of type ReloadException
|
// exception object of type ReloadException
|
||||||
mp_obj_exception_t mp_reload_exception;
|
mp_obj_exception_t mp_reload_exception;
|
||||||
|
// traceback object to store traceback
|
||||||
|
mp_obj_traceback_t mp_reload_traceback;
|
||||||
|
|
||||||
// dictionary with loaded modules (may be exposed as sys.modules)
|
// dictionary with loaded modules (may be exposed as sys.modules)
|
||||||
mp_obj_dict_t mp_loaded_modules_dict;
|
mp_obj_dict_t mp_loaded_modules_dict;
|
||||||
|
@ -86,7 +86,8 @@ void mp_init(void) {
|
|||||||
|
|
||||||
MP_STATE_VM(mp_reload_exception).base.type = &mp_type_ReloadException;
|
MP_STATE_VM(mp_reload_exception).base.type = &mp_type_ReloadException;
|
||||||
MP_STATE_VM(mp_reload_exception).args = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj;
|
MP_STATE_VM(mp_reload_exception).args = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj;
|
||||||
MP_STATE_VM(mp_reload_exception).traceback = (mp_obj_traceback_t *)&mp_const_empty_traceback_obj;
|
MP_STATE_VM(mp_reload_exception).traceback = &MP_STATE_VM(mp_reload_traceback);
|
||||||
|
*MP_STATE_VM(mp_reload_exception).traceback = mp_const_empty_traceback_obj;
|
||||||
|
|
||||||
// call port specific initialization if any
|
// call port specific initialization if any
|
||||||
#ifdef MICROPY_PORT_INIT_FUNC
|
#ifdef MICROPY_PORT_INIT_FUNC
|
||||||
|
Loading…
Reference in New Issue
Block a user