https://github.com/python/cpython/commit/35ef8cb25917bfd6cbbd7c2bb55dd4f82131c9cf
commit: 35ef8cb25917bfd6cbbd7c2bb55dd4f82131c9cf
branch: main
author: Brandt Bucher <[email protected]>
committer: markshannon <[email protected]>
date: 2024-01-04T11:14:15Z
summary:

GH-113689: Fix broken handling of invalid executors (GH-113694)

files:
M Python/bytecodes.c
M Python/generated_cases.c.h

diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 2eeeac53e1dd7e..e1a6a256fbdf96 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -2378,11 +2378,12 @@ dummy_func(
                 stack_pointer = _PyFrame_GetStackPointer(frame);
             }
             else {
+                code->co_executors->executors[oparg & 255] = NULL;
                 opcode = this_instr->op.code = executor->vm_data.opcode;
                 this_instr->op.arg = executor->vm_data.oparg;
                 oparg = (oparg & (~255)) | executor->vm_data.oparg;
-                code->co_executors->executors[oparg&255] = NULL;
                 Py_DECREF(executor);
+                next_instr = this_instr;
                 DISPATCH_GOTO();
             }
         }
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 99fd169ca4fec3..8226d827cde514 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -2392,11 +2392,12 @@
                 stack_pointer = _PyFrame_GetStackPointer(frame);
             }
             else {
+                code->co_executors->executors[oparg & 255] = NULL;
                 opcode = this_instr->op.code = executor->vm_data.opcode;
                 this_instr->op.arg = executor->vm_data.oparg;
                 oparg = (oparg & (~255)) | executor->vm_data.oparg;
-                code->co_executors->executors[oparg&255] = NULL;
                 Py_DECREF(executor);
+                next_instr = this_instr;
                 DISPATCH_GOTO();
             }
             DISPATCH();

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to