From 7bb3b93c8fc757b94f5902340a7e3ebe15f8eb6e Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Tue, 5 Sep 2023 15:03:20 +0100 Subject: [PATCH] add assert --- Python/ceval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Python/ceval.c b/Python/ceval.c index 034166911ec7ca4..1df7f82f4084dc3 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -718,6 +718,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int /* Because this avoids the RESUME, * we need to update instrumentation */ _Py_Instrument(_PyFrame_GetCode(frame), tstate->interp); + assert (frame->instr_ptr == frame->prev_instr + 1); monitor_throw(tstate, frame, frame->prev_instr); /* TO DO -- Monitor throw entry. */ goto resume_with_error; @@ -733,7 +734,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int #define SET_LOCALS_FROM_FRAME() \ /* Jump back to the last instruction executed... */ \ assert (frame->instr_ptr == frame->prev_instr + 1); \ - next_instr = frame->prev_instr + 1; \ + next_instr = frame->instr_ptr; \ stack_pointer = _PyFrame_GetStackPointer(frame); start_frame: