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:
ip--;
PUSH(ret_value);
goto yield;
}
if (ret_kind == MP_VM_RETURN_NORMAL) {
} else if (ret_kind == MP_VM_RETURN_NORMAL) {
// Pop exhausted gen
sp--;
// TODO: When ret_value can be MP_OBJ_NULL here??
......@@ -1176,8 +1175,8 @@ yield:
// if it was swallowed, we re-raise GeneratorExit
GENERATOR_EXIT_IF_NEEDED(t_exc);
DISPATCH();
}
if (ret_kind == MP_VM_RETURN_EXCEPTION) {
} else {
assert(ret_kind == MP_VM_RETURN_EXCEPTION);
// Pop exhausted gen
sp--;
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.
Finish editing this message first!
Please register or to comment