]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-113689: Fix broken handling of invalid executors (GH-113694)
authorBrandt Bucher <brandtbucher@microsoft.com>
Thu, 4 Jan 2024 11:14:15 +0000 (03:14 -0800)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 11:14:15 +0000 (11:14 +0000)
Python/bytecodes.c
Python/generated_cases.c.h

index 2eeeac53e1dd7e32945013b28ac468749df16307..e1a6a256fbdf96ffa57147ced6a2003e6b02830d 100644 (file)
@@ -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();
             }
         }
index 99fd169ca4fec3782cc9cd1ac67d9ddca61aab57..8226d827cde51437172bf1543abc9a77fd3e35d4 100644 (file)
                 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();