8000 unix/coverage.c: Initialize more code_state fields. · micropython/micropython@d134cdb · GitHub
[go: up one dir, main page]

Skip to content

Commit d134cdb

Browse files
committed
unix/coverage.c: Initialize more code_state fields.
When MICROPY_PY_SYS_SETTRACE was enabled, a crash was seen in the qemu_mips build. It seems likely that this was due to these added fields not being initialized. Signed-off-by: Jeff Epler <jepler@gmail.com>
1 parent 22c0311 commit d134cdb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ports/unix/coverage.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ - 87F2 588,6 +588,14 @@ static mp_obj_t extra_coverage(void) {
588588
code_state->sp = &code_state->state[0];
589589
code_state->exc_sp_idx = 0;
590590
code_state->old_globals = NULL;
591+
#if MICROPY_STACKLESS
592+
code_state->prev = NULL;
593+
#endif
594+
#if MICROPY_PY_SYS_SETTRACE
595+
code_state->prev_state = NULL;
596+
code_state->frame = NULL;
597+
#endif
598+
591599
mp_vm_return_kind_t ret = mp_execute_bytecode(code_state, MP_OBJ_NULL);
592600
mp_printf(&mp_plat_print, "%d %d\n", ret, mp_obj_get_type(code_state->state[0]) == &mp_type_NotImplementedError);
593601
}

0 commit comments

Comments
 (0)
0