@@ -1565,16 +1565,6 @@ trace_function_exit(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject
15651565 return 0 ;
15661566}
15671567
1568- static int
1569- skip_backwards_over_extended_args (PyCodeObject * code , int offset )
1570- {
1571- _Py_CODEUNIT * instrs = (_Py_CODEUNIT * )PyBytes_AS_STRING (code -> co_code );
1572- while (offset > 0 && _Py_OPCODE (instrs [offset - 1 ]) == EXTENDED_ARG ) {
1573- offset -- ;
1574- }
1575- return offset ;
1576- }
1577-
15781568static _PyInterpreterFrame *
15791569pop_frame (PyThreadState * tstate , _PyInterpreterFrame * frame )
15801570{
@@ -5445,7 +5435,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
54455435#endif
54465436 {
54475437 if (tstate -> tracing == 0 ) {
5448- int instr_prev = skip_backwards_over_extended_args ( frame -> f_code , frame -> f_lasti ) ;
5438+ int instr_prev = frame -> f_lasti ;
54495439 frame -> f_lasti = INSTR_OFFSET ();
54505440 TRACING_NEXTOPARG ();
54515441 if (opcode == RESUME ) {
@@ -6737,9 +6727,13 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj,
67376727 then call the trace function if we're tracing source lines.
67386728 */
67396729 initialize_trace_info (& tstate -> trace_info , frame );
6740- _Py_CODEUNIT prev = ((_Py_CODEUNIT * )PyBytes_AS_STRING (frame -> f_code -> co_code ))[instr_prev ];
6730+ int entry_point = 0 ;
6731+ _Py_CODEUNIT * code = (_Py_CODEUNIT * )PyBytes_AS_STRING (frame -> f_code -> co_code );
6732+ while (_Py_OPCODE (code [entry_point ]) != RESUME ) {
6733+ entry_point ++ ;
6734+ }
67416735 int lastline ;
6742- if (_Py_OPCODE ( prev ) == RESUME && _Py_OPARG ( prev ) == 0 ) {
6736+ if (instr_prev <= entry_point ) {
67436737 lastline = -1 ;
67446738 }
67456739 else {
0 commit comments