Skip to content
Snippets Groups Projects
Commit 9ed5e80e authored by Damien George's avatar Damien George
Browse files

py/vm: Make "if" control flow more obvious in YIELD_FROM opcode.

parent 9d2c72ad
No related branches found
No related tags found
No related merge requests found
...@@ -1159,8 +1159,7 @@ yield: ...@@ -1159,8 +1159,7 @@ yield:
ip--; ip--;
PUSH(ret_value); PUSH(ret_value);
goto yield; goto yield;
} } else if (ret_kind == MP_VM_RETURN_NORMAL) {
if (ret_kind == MP_VM_RETURN_NORMAL) {
// Pop exhausted gen // Pop exhausted gen
sp--; sp--;
// TODO: When ret_value can be MP_OBJ_NULL here?? // TODO: When ret_value can be MP_OBJ_NULL here??
...@@ -1176,8 +1175,8 @@ yield: ...@@ -1176,8 +1175,8 @@ yield:
// if it was swallowed, we re-raise GeneratorExit // if it was swallowed, we re-raise GeneratorExit
GENERATOR_EXIT_IF_NEEDED(t_exc); GENERATOR_EXIT_IF_NEEDED(t_exc);
DISPATCH(); DISPATCH();
} } else {
if (ret_kind == MP_VM_RETURN_EXCEPTION) { assert(ret_kind == MP_VM_RETURN_EXCEPTION);
// Pop exhausted gen // Pop exhausted gen
sp--; sp--;
if (EXC_MATCH(ret_value, MP_OBJ_FROM_PTR(&mp_type_StopIteration))) { if (EXC_MATCH(ret_value, MP_OBJ_FROM_PTR(&mp_type_StopIteration))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment