diff options
author | Damien George <damien.p.george@gmail.com> | 2019-01-04 17:22:40 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-01-04 17:22:40 +1100 |
commit | afecc124e6a9bb905acae963d759b60ed9ec4f71 (patch) | |
tree | cc3c449a1400d27f037dab0396d13b139259abf3 /py | |
parent | 6d199344631b9706eab828fe29b795578a81c618 (diff) |
py: Fix location of VM returned exception in invalid opcode and comments
The location for a returned exception was changed to state[0] in
d95947b48a30f818638c3619b92110ce6d07f5e3
Diffstat (limited to 'py')
-rw-r--r-- | py/objfun.c | 2 | ||||
-rw-r--r-- | py/vm.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/py/objfun.c b/py/objfun.c index 6f6c4dc22..a05d44632 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -323,7 +323,7 @@ STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const } else { // must be an exception because normal functions can't yield assert(vm_return_kind == MP_VM_RETURN_EXCEPTION); - // return value is in fastn[0]==state[n_state - 1] + // returned exception is in state[0] result = code_state->state[0]; } @@ -115,7 +115,7 @@ // returns: // MP_VM_RETURN_NORMAL, sp valid, return value in *sp // MP_VM_RETURN_YIELD, ip, sp valid, yielded value in *sp -// MP_VM_RETURN_EXCEPTION, exception in fastn[0] +// MP_VM_RETURN_EXCEPTION, exception in state[0] mp_vm_return_kind_t mp_execute_bytecode(mp_code_state_t *code_state, volatile mp_obj_t inject_exc) { #define SELECTIVE_EXC_IP (0) #if SELECTIVE_EXC_IP @@ -1274,7 +1274,7 @@ yield: { mp_obj_t obj = mp_obj_new_exception_msg(&mp_type_NotImplementedError, "byte code not implemented"); nlr_pop(); - fastn[0] = obj; + code_state->state[0] = obj; return MP_VM_RETURN_EXCEPTION; } |