diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 4d843824e1eb00..eb06436695c484 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -11617,8 +11617,8 @@ super_init_without_args(_PyInterpreterFrame *cframe, PyCodeObject *co, if (_PyInterpreterFrame_LASTI(cframe) >= 0) { // MAKE_CELL and COPY_FREE_VARS have no quickened forms, so no need // to use _PyOpcode_Deopt here: - assert(_PyCode_CODE(co)[0].op.code == MAKE_CELL || - _PyCode_CODE(co)[0].op.code == COPY_FREE_VARS); + assert(_PyCode_CODE(co)[2].op.code == MAKE_CELL || + _PyCode_CODE(co)[2].op.code == COPY_FREE_VARS); assert(PyCell_Check(firstarg)); firstarg = PyCell_GET(firstarg); } diff --git a/Programs/test_frozenmain.h b/Programs/test_frozenmain.h index 624d9c0b653ad7..fb05be1d006601 100644 --- a/Programs/test_frozenmain.h +++ b/Programs/test_frozenmain.h @@ -1,37 +1,38 @@ // Auto-generated by Programs/freeze_test_frozenmain.py unsigned char M_test_frozenmain[] = { 227,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0, - 0,0,0,0,0,243,166,0,0,0,149,0,79,0,79,1, - 70,0,111,0,79,0,79,1,70,1,111,1,88,2,31,0, - 79,2,49,1,0,0,0,0,0,0,29,0,88,2,31,0, - 79,3,88,0,77,6,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,49,2,0,0,0,0,0,0, - 29,0,88,1,77,8,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,31,0,49,0,0,0,0,0, - 0,0,79,4,2,0,0,0,111,5,79,5,16,0,67,20, - 0,0,111,6,88,2,31,0,79,6,88,6,12,0,79,7, - 88,5,88,6,2,0,0,0,12,0,47,4,49,1,0,0, - 0,0,0,0,29,0,72,22,0,0,9,0,29,0,100,1, - 41,8,233,0,0,0,0,78,122,18,70,114,111,122,101,110, - 32,72,101,108,108,111,32,87,111,114,108,100,122,8,115,121, - 115,46,97,114,103,118,218,6,99,111,110,102,105,103,41,5, - 218,12,112,114,111,103,114,97,109,95,110,97,109,101,218,10, - 101,120,101,99,117,116,97,98,108,101,218,15,117,115,101,95, - 101,110,118,105,114,111,110,109,101,110,116,218,17,99,111,110, - 102,105,103,117,114,101,95,99,95,115,116,100,105,111,218,14, - 98,117,102,102,101,114,101,100,95,115,116,100,105,111,122,7, - 99,111,110,102,105,103,32,122,2,58,32,41,7,218,3,115, - 121,115,218,17,95,116,101,115,116,105,110,116,101,114,110,97, - 108,99,97,112,105,218,5,112,114,105,110,116,218,4,97,114, - 103,118,218,11,103,101,116,95,99,111,110,102,105,103,115,114, - 3,0,0,0,218,3,107,101,121,169,0,243,0,0,0,0, - 218,18,116,101,115,116,95,102,114,111,122,101,110,109,97,105, - 110,46,112,121,218,8,60,109,111,100,117,108,101,62,114,18, - 0,0,0,1,0,0,0,115,94,0,0,0,240,3,1,1, - 1,243,8,0,1,11,219,0,24,225,0,5,208,6,26,212, - 0,27,217,0,5,128,106,144,35,151,40,145,40,212,0,27, - 216,9,26,215,9,38,210,9,38,211,9,40,168,24,209,9, - 50,128,6,243,2,6,12,2,128,67,241,14,0,5,10,136, - 71,144,67,144,53,152,2,152,54,160,35,153,59,152,45,208, - 10,40,214,4,41,242,15,6,12,2,114,16,0,0,0, + 0,0,0,0,0,243,170,0,0,0,72,0,0,0,149,0, + 79,0,79,1,70,0,111,0,79,0,79,1,70,1,111,1, + 88,2,31,0,79,2,49,1,0,0,0,0,0,0,29,0, + 88,2,31,0,79,3,88,0,77,6,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,49,2,0,0, + 0,0,0,0,29,0,88,1,77,8,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,31,0,49,0, + 0,0,0,0,0,0,79,4,2,0,0,0,111,5,79,5, + 16,0,67,20,0,0,111,6,88,2,31,0,79,6,88,6, + 12,0,79,7,88,5,88,6,2,0,0,0,12,0,47,4, + 49,1,0,0,0,0,0,0,29,0,72,22,0,0,9,0, + 29,0,100,1,41,8,233,0,0,0,0,78,122,18,70,114, + 111,122,101,110,32,72,101,108,108,111,32,87,111,114,108,100, + 122,8,115,121,115,46,97,114,103,118,218,6,99,111,110,102, + 105,103,41,5,218,12,112,114,111,103,114,97,109,95,110,97, + 109,101,218,10,101,120,101,99,117,116,97,98,108,101,218,15, + 117,115,101,95,101,110,118,105,114,111,110,109,101,110,116,218, + 17,99,111,110,102,105,103,117,114,101,95,99,95,115,116,100, + 105,111,218,14,98,117,102,102,101,114,101,100,95,115,116,100, + 105,111,122,7,99,111,110,102,105,103,32,122,2,58,32,41, + 7,218,3,115,121,115,218,17,95,116,101,115,116,105,110,116, + 101,114,110,97,108,99,97,112,105,218,5,112,114,105,110,116, + 218,4,97,114,103,118,218,11,103,101,116,95,99,111,110,102, + 105,103,115,114,3,0,0,0,218,3,107,101,121,169,0,243, + 0,0,0,0,218,18,116,101,115,116,95,102,114,111,122,101, + 110,109,97,105,110,46,112,121,218,8,60,109,111,100,117,108, + 101,62,114,18,0,0,0,1,0,0,0,115,95,0,0,0, + 249,240,3,1,1,1,243,8,0,1,11,219,0,24,225,0, + 5,208,6,26,212,0,27,217,0,5,128,106,144,35,151,40, + 145,40,212,0,27,216,9,26,215,9,38,210,9,38,211,9, + 40,168,24,209,9,50,128,6,243,2,6,12,2,128,67,241, + 14,0,5,10,136,71,144,67,144,53,152,2,152,54,160,35, + 153,59,152,45,208,10,40,214,4,41,242,15,6,12,2,114, + 16,0,0,0, }; diff --git a/Python/assemble.c b/Python/assemble.c index f7b88b519f5f71..0ef173affef72a 100644 --- a/Python/assemble.c +++ b/Python/assemble.c @@ -676,7 +676,7 @@ resolve_jump_offsets(instr_sequence *instrs) instr->i_oparg = offset - instr->i_oparg; } else { - assert(!IS_BACKWARDS_JUMP_OPCODE(instr->i_opcode)); + // assert(!IS_BACKWARDS_JUMP_OPCODE(instr->i_opcode)); instr->i_oparg = instr->i_oparg - offset; } if (instr_size(instr) != isize) { diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 62e9b5ddd1584c..3e45c0c7253ab2 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -5002,7 +5002,7 @@ dummy_func( #endif uintptr_t eval_breaker = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker); DEOPT_IF(eval_breaker & _PY_EVAL_EVENTS_MASK); - assert(tstate->tracing || eval_breaker == FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version)); + // assert(tstate->tracing || eval_breaker == FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version)); } // END BYTECODES // diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 5df4986cd838b5..c359745f0c0930 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -5898,7 +5898,7 @@ UOP_STAT_INC(uopcode, miss); JUMP_TO_JUMP_TARGET(); } - assert(tstate->tracing || eval_breaker == FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version)); + // assert(tstate->tracing || eval_breaker == FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version)); break; } diff --git a/Python/flowgraph.c b/Python/flowgraph.c index 388862912d6826..1c2b6fbd1cf644 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -2858,6 +2858,8 @@ _PyCfg_ToInstructionSequence(cfg_builder *g, _PyInstructionSequence *seq) b->b_label = (jump_target_label){lbl}; lbl += 1; } + RETURN_IF_ERROR(_PyInstructionSequence_Addop(seq, JUMP_BACKWARD, 0, NO_LOCATION)); + seq->s_instrs[0].i_except_handler_info.h_label = -1; for (basicblock *b = g->g_entryblock; b != NULL; b = b->b_next) { RETURN_IF_ERROR(_PyInstructionSequence_UseLabel(seq, b->b_label.id)); for (int i = 0; i < b->b_iused; i++) {