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

This commit is contained in:
Brandt Bucher 2024-01-04 03:14:15 -08:00 committed by GitHub
parent 4c4b08dd2b
commit 35ef8cb259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View 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();
}
}

View File

@ -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();