Skip to content
Closed
Prev Previous commit
Merge remote-tracking branch 'origin/main' into bpo-44800-py-frame-mi…
…nimal-changes
  • Loading branch information
ncoghlan committed Mar 21, 2022
commit 763a615a20eade7cd0472c08375069da54b3ea7b
4 changes: 1 addition & 3 deletions Objects/genobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,7 @@ _PyGen_yf(PyGenObject *gen)
PyObject *yf = NULL;

if (gen->gi_frame_valid) {
_Py_frame *frame = (_Py_frame *)gen->gi_iframe;
PyObject *bytecode = gen->gi_code->co_code;
unsigned char *code = (unsigned char *)PyBytes_AS_STRING(bytecode);
_Py_frame *frame = (_PyInterpreterFrame *)gen->gi_iframe;

if (frame->f_lasti < 1) {
/* Return immediately if the frame didn't start yet. SEND
Expand Down
5 changes: 4 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -8949,7 +8949,10 @@ super_init_without_args(_Py_frame *frame, PyCodeObject *co,
// "firstarg" is a cell here unless (very unlikely) super()
// was called from the C-API before the first MAKE_CELL op.
if (frame->f_lasti >= 0) {
assert(_Py_OPCODE(*co->co_firstinstr) == MAKE_CELL || _Py_OPCODE(*co->co_firstinstr) == COPY_FREE_VARS);
// MAKE_CELL and COPY_FREE_VARS have no quickened forms, so no need
// to use _PyOpcode_Deopt here:
assert(_Py_OPCODE(_PyCode_CODE(co)[0]) == MAKE_CELL ||
_Py_OPCODE(_PyCode_CODE(co)[0]) == COPY_FREE_VARS);
assert(PyCell_Check(firstarg));
firstarg = PyCell_GET(firstarg);
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.