@@ -1090,7 +1090,7 @@ dummy_func(
10901090 }
10911091
10921092 tier1 inst (INTERPRETER_EXIT , (retval -- )) {
1093- assert (frame == & entry_frame );
1093+ assert (frame -> owner == FRAME_OWNED_BY_INTERPRETER );
10941094 assert (_PyFrame_IsIncomplete (frame ));
10951095 /* Restore previous frame and return. */
10961096 tstate -> current_frame = frame -> previous ;
@@ -1105,9 +1105,7 @@ dummy_func(
11051105 // retval is popped from the stack, but res
11061106 // is pushed to a different frame, the callers' frame.
11071107 inst (RETURN_VALUE , (retval -- res )) {
1108- #if TIER_ONE
1109- assert (frame != & entry_frame );
1110- #endif
1108+ assert (frame -> owner != FRAME_OWNED_BY_INTERPRETER );
11111109 _PyStackRef temp = retval ;
11121110 DEAD (retval );
11131111 SAVE_STACK ();
@@ -1205,7 +1203,7 @@ dummy_func(
12051203 PyObject * receiver_o = PyStackRef_AsPyObjectBorrow (receiver );
12061204
12071205 PyObject * retval_o ;
1208- assert (frame != & entry_frame );
1206+ assert (frame -> owner != FRAME_OWNED_BY_INTERPRETER );
12091207 if ((tstate -> interp -> eval_frame == NULL ) &&
12101208 (Py_TYPE (receiver_o ) == & PyGen_Type || Py_TYPE (receiver_o ) == & PyCoro_Type ) &&
12111209 ((PyGenObject * )receiver_o )-> gi_frame_state < FRAME_EXECUTING )
@@ -1278,9 +1276,7 @@ dummy_func(
12781276 // NOTE: It's important that YIELD_VALUE never raises an exception!
12791277 // The compiler treats any exception raised here as a failed close()
12801278 // or throw() call.
1281- #if TIER_ONE
1282- assert (frame != & entry_frame );
1283- #endif
1279+ assert (frame -> owner != FRAME_OWNED_BY_INTERPRETER );
12841280 frame -> instr_ptr ++ ;
12851281 PyGenObject * gen = _PyGen_GetGeneratorFromFrame (frame );
12861282 assert (FRAME_SUSPENDED_YIELD_FROM == FRAME_SUSPENDED + 1 );
0 commit comments