diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-03-31 04:19:12 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-03-31 17:22:37 +0300 |
commit | 7da0660516e1406808ad212d35faa95de3316fc4 (patch) | |
tree | 58a042e14fa21995c3c83758c8113c8e9411d594 /py/runtime.c | |
parent | a2109d93210c391d45a0ced2ce8a85f2471d3543 (diff) | |
download | micropython-7da0660516e1406808ad212d35faa95de3316fc4.tar.gz micropython-7da0660516e1406808ad212d35faa95de3316fc4.zip |
mp_resume: Dare to pass send_value of NULL.
There was thinkos that either send_value or throw_value is specified, but
there were cases with both. Note that send_value is pushed onto generator's
stack - but that's probably only good, because if we throw exception into
gen, it should not ever use send_value, and that will be just extra "assert".
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index f7e08e37f5..65bb808a9b 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -915,6 +915,7 @@ mp_obj_t mp_iternext(mp_obj_t o_in) { // TODO: Unclear what to do with StopIterarion exception here. mp_vm_return_kind_t mp_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val) { + assert((send_value != MP_OBJ_NULL) ^ (throw_value != MP_OBJ_NULL)); mp_obj_type_t *type = mp_obj_get_type(self_in); if (type == &mp_type_gen_instance) { |