1 parent 9d2c72a commit 9ed5e80Copy full SHA for 9ed5e80
1 file changed
py/vm.c
@@ -1159,8 +1159,7 @@ unwind_jump:;
1159
ip--;
1160
PUSH(ret_value);
1161
goto yield;
1162
- }
1163
- if (ret_kind == MP_VM_RETURN_NORMAL) {
+ } else if (ret_kind == MP_VM_RETURN_NORMAL) {
1164
// Pop exhausted gen
1165
sp--;
1166
// TODO: When ret_value can be MP_OBJ_NULL here??
@@ -1176,8 +1175,8 @@ unwind_jump:;
1176
1175
// if it was swallowed, we re-raise GeneratorExit
1177
GENERATOR_EXIT_IF_NEEDED(t_exc);
1178
DISPATCH();
1179
1180
- if (ret_kind == MP_VM_RETURN_EXCEPTION) {
+ } else {
+ assert(ret_kind == MP_VM_RETURN_EXCEPTION);
1181
1182
1183
if (EXC_MATCH(ret_value, MP_OBJ_FROM_PTR(&mp_type_StopIteration))) {
0 commit comments