Skip to content

Commit 59dd959

Browse files
committed
Support tail-calling
1 parent 492df4e commit 59dd959

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/ceval_macros.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
#define INSTRUCTION_STATS(op) ((void)0)
7171
#endif
7272

73-
#define TAIL_CALL_PARAMS _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg
74-
#define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg
73+
#define TAIL_CALL_PARAMS _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, _Py_CODEUNIT *next_instr, int oparg, _PyStackRef _tos
74+
#define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg, _tos
7575

7676
#if Py_TAIL_CALL_INTERP
7777
// Note: [[clang::musttail]] works for GCC 15, but not __attribute__((musttail)) at the moment.
@@ -90,7 +90,7 @@
9090
} while (0)
9191
# define JUMP_TO_PREDICTED(name) \
9292
do { \
93-
Py_MUSTTAIL return (_TAIL_CALL_##name)(frame, stack_pointer, tstate, this_instr, oparg); \
93+
Py_MUSTTAIL return (_TAIL_CALL_##name)(frame, stack_pointer, tstate, this_instr, oparg, _tos); \
9494
} while (0)
9595
# define LABEL(name) TARGET(name)
9696
#elif USE_COMPUTED_GOTOS

0 commit comments

Comments
 (0)