8000 revert change to signature of _PyFrame_PushTrampolineUnchecked · python/cpython@da6c97b · GitHub
[go: up one dir, main page]

Skip to content

Commit da6c97b

Browse files
committed
revert change to signature of _PyFrame_PushTrampolineUnchecked
1 parent 0a06b75 commit da6c97b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Include/internal/pycore_frame.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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() */
287287
static 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;

Python/bytecodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3157,7 +3157,7 @@ dummy_func(
31573157
}
31583158
Py_DECREF(tp);
31593159
_PyInterpreterFrame *shim = _PyFrame_PushTrampolineUnchecked(
3160-
tstate, (PyCodeObject *)&_Py_InitCleanup, 1, 0, 1);
3160+
tstate, (PyCodeObject *)&_Py_InitCleanup, 1, 0);
31613161
assert(_PyCode_CODE((PyCodeObject *)shim->f_executable)[1].op.code == EXIT_INIT_CHECK);
31623162
/* Push self onto stack of shim */
31633163
Py_INCREF(self);

Python/generated_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0