]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-115735: Fix current executor NULL before _START_EXECUTOR (#115736)
authorKen Jin <kenjin@python.org>
Tue, 20 Feb 2024 18:47:05 +0000 (02:47 +0800)
committerGitHub <noreply@github.com>
Tue, 20 Feb 2024 18:47:05 +0000 (18:47 +0000)
This fixes level 3 or higher lltrace debug output `--with-pydebug` runs.

Python/ceval.c

index 596d5f449c06fa9c1f482e986b4bae050515e9c8..b7a5d629c9466b7ce0d7b53b4eb8a183a0c43ff7 100644 (file)
@@ -1008,7 +1008,7 @@ enter_tier_two:
         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 @@ enter_tier_two:
             {
                 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