Skip to content

Commit 7a8c3ed

Browse files
gh-115735: Fix current executor NULL before _START_EXECUTOR (#115736)
This fixes level 3 or higher lltrace debug output `--with-pydebug` runs.
1 parent e3ad6ca commit 7a8c3ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10081008
uopcode = next_uop->opcode;
10091009
DPRINTF(3,
10101010
"%4d: uop %s, oparg %d, operand %" PRIu64 ", target %d, stack_level %d\n",
1011-
(int)(next_uop - current_executor->trace),
1011+
(int)(next_uop - (current_executor == NULL ? next_uop : current_executor->trace)),
10121012
_PyUOpName(uopcode),
10131013
next_uop->oparg,
10141014
next_uop->operand,
@@ -1030,7 +1030,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10301030
{
10311031
fprintf(stderr, "Unknown uop %d, oparg %d, operand %" PRIu64 " @ %d\n",
10321032
next_uop[-1].opcode, next_uop[-1].oparg, next_uop[-1].operand,
1033-
(int)(next_uop - current_executor->trace - 1));
1033+
(int)(next_uop - (current_executor == NULL ? next_uop : current_executor->trace) - 1));
10341034
Py_FatalError("Unknown uop");
10351035
}
10361036
#else

0 commit comments

Comments
 (0)