gh-115735: Fix current executor NULL before _START_EXECUTOR (#115736)

This fixes level 3 or higher lltrace debug output `--with-pydebug` runs.
This commit is contained in:
Ken Jin 2024-02-21 02:47:05 +08:00 committed by GitHub
parent e3ad6ca56f
commit 7a8c3ed43a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1008,7 +1008,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
uopcode = next_uop->opcode;
DPRINTF(3,
"%4d: uop %s, oparg %d, operand %" PRIu64 ", target %d, stack_level %d\n",
(int)(next_uop - current_executor->trace),
(int)(next_uop - (current_executor == NULL ? next_uop : current_executor->trace)),
_PyUOpName(uopcode),
next_uop->oparg,
next_uop->operand,
@ -1030,7 +1030,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
{
fprintf(stderr, "Unknown uop %d, oparg %d, operand %" PRIu64 " @ %d\n",
next_uop[-1].opcode, next_uop[-1].oparg, next_uop[-1].operand,
(int)(next_uop - current_executor->trace - 1));
(int)(next_uop - (current_executor == NULL ? next_uop : current_executor->trace) - 1));
Py_FatalError("Unknown uop");
}
#else