]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104584: Replace ENTER_EXECUTOR with the original in trace projection (#106526)
authorGuido van Rossum <guido@python.org>
Fri, 7 Jul 2023 18:41:42 +0000 (11:41 -0700)
committerGitHub <noreply@github.com>
Fri, 7 Jul 2023 18:41:42 +0000 (11:41 -0700)
Python/optimizer.c

index 2870f2fd05052ec076df404066b6cc3fdcae9351..1d731ed2309c3c6508ec78f5d8adb6879f4fa611 100644 (file)
@@ -419,6 +419,12 @@ translate_bytecode_to_trace(
             opcode = instr->op.code;
             oparg = (oparg << 8) | instr->op.arg;
         }
+        if (opcode == ENTER_EXECUTOR) {
+            _PyExecutorObject *executor = (_PyExecutorObject *)code->co_executors->executors[oparg&255];
+            opcode = executor->vm_data.opcode;
+            DPRINTF(2, "  * ENTER_EXECUTOR -> %s\n",  _PyOpcode_OpName[opcode]);
+            oparg = (oparg & 0xffffff00) | executor->vm_data.oparg;
+        }
         switch (opcode) {
             default:
             {