py/bc: Change mp_code_state_t.exc_sp to exc_sp_idx.

Change from a pointer to an index, to make space in mp_code_state_t.
This commit is contained in:
Damien George
2019-09-23 23:37:01 +10:00
parent 1d7afcce49
commit 4c5e1a0368
5 changed files with 19 additions and 12 deletions

View File

@@ -133,7 +133,7 @@ void mp_setup_code_state(mp_code_state_t *code_state, size_t n_args, size_t n_kw
size_t n_def_pos_args = *code_state->ip++;
code_state->sp = &code_state->state[0] - 1;
code_state->exc_sp = (mp_exc_stack_t*)(code_state->state + n_state) - 1;
code_state->exc_sp_idx = 0;
// zero out the local stack to begin with
memset(code_state->state, 0, n_state * sizeof(*code_state->state));