summaryrefslogtreecommitdiff
path: root/py/objgenerator.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-09-23 23:37:01 +1000
committerDamien George <damien.p.george@gmail.com>2019-10-01 12:26:22 +1000
commit4c5e1a036831a3ac36866e4daab3a50c772b4443 (patch)
tree795134f3011461f5574d64d545a3061eff655ea8 /py/objgenerator.c
parent1d7afcce49366c11f67561019a5adf5e60c450f5 (diff)
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.
Diffstat (limited to 'py/objgenerator.c')
-rw-r--r--py/objgenerator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objgenerator.c b/py/objgenerator.c
index 62e644616..d32a74f3f 100644
--- a/py/objgenerator.c
+++ b/py/objgenerator.c
@@ -102,7 +102,7 @@ STATIC mp_obj_t native_gen_wrap_call(mp_obj_t self_in, size_t n_args, size_t n_k
mp_setup_code_state(&o->code_state, n_args, n_kw, args);
// Indicate we are a native function, which doesn't use this variable
- o->code_state.exc_sp = NULL;
+ o->code_state.exc_sp_idx = MP_CODE_STATE_EXC_SP_IDX_SENTINEL;
// Prepare the generator instance for execution
uintptr_t start_offset = ((uintptr_t*)self_fun->bytecode)[1];
@@ -172,7 +172,7 @@ mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_
mp_vm_return_kind_t ret_kind;
#if MICROPY_EMIT_NATIVE
- if (self->code_state.exc_sp == NULL) {
+ if (self->code_state.exc_sp_idx == MP_CODE_STATE_EXC_SP_IDX_SENTINEL) {
// A native generator, with entry point 2 words into the "bytecode" pointer
typedef uintptr_t (*mp_fun_native_gen_t)(void*, mp_obj_t);
mp_fun_native_gen_t fun = MICROPY_MAKE_POINTER_CALLABLE((const void*)(self->code_state.fun_bc->bytecode + 2 * sizeof(uintptr_t)));