@@ -67,7 +67,7 @@ typedef struct _PyInterpreterFrame {
6767 _Py_CODEUNIT * instr_ptr ;
6868 int stacktop ; /* Offset of TOS from localsplus */
6969 /* The return_offset determines where a `RETURN` should go in the caller,
70- * relative to `prev_instr`.
70+ * relative to `prev_instr`/`instr_ptr` .
7171 * It is only meaningful to the callee,
7272 * so it needs to be set in any CALL (to a Python function)
7373 * or SEND (to a coroutine or generator).
@@ -285,7 +285,7 @@ _PyFrame_PushUnchecked(PyThreadState *tstate, PyFunctionObject *func, int null_l
285285/* Pushes a trampoline frame without checking for space.
286286 * Must be guarded by _PyThreadState_HasStackSpace() */
287287static inline _PyInterpreterFrame *
288- _PyFrame_PushTrampolineUnchecked (PyThreadState * tstate , PyCodeObject * code , int stackdepth , int prev_instr , int instr_ptr_offset )
288+ _PyFrame_PushTrampolineUnchecked (PyThreadState * tstate , PyCodeObject * code , int stackdepth , int prev_instr )
289289{
290290 CALL_STAT_INC (frames_pushed );
291291 _PyInterpreterFrame * frame = (_PyInterpreterFrame * )tstate -> datastack_top ;
@@ -301,7 +301,7 @@ _PyFrame_PushTrampolineUnchecked(PyThreadState *tstate, PyCodeObject *code, int
301301 frame -> stacktop = code -> co_nlocalsplus + stackdepth ;
302302 frame -> frame_obj = NULL ;
303303 frame -> prev_instr = _PyCode_CODE (code ) + prev_instr ;
304- frame -> instr_ptr = _PyCode_CODE (code ) + instr_ptr_offset ;
304+ frame -> instr_ptr = _PyCode_CODE (code ) + prev_instr + 1 ;
305305 frame -> owner = FRAME_OWNED_BY_THREAD ;
306306 frame -> return_offset = 0 ;
307307 return frame ;
0 commit comments