aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/executor.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-10-26 14:43:10 +0100
committerGitHub <noreply@github.com>2023-10-26 13:43:10 +0000
commit67a91f78e4395148afcc33e5cd6f3f0a9623e63a (patch)
tree2d5bf1f7ead447934ce68aa42279708a7c32fa28 /Python/executor.c
parent573eff3e2ec36b5ec77c3601592a652e524abe21 (diff)
downloadcpython-67a91f78e4395148afcc33e5cd6f3f0a9623e63a.tar.gz
cpython-67a91f78e4395148afcc33e5cd6f3f0a9623e63a.zip
gh-109094: replace frame->prev_instr by frame->instr_ptr (#109095)
Diffstat (limited to 'Python/executor.c')
-rw-r--r--Python/executor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/executor.c b/Python/executor.c
index 1630f018626..bfa7f7e1c3d 100644
--- a/Python/executor.c
+++ b/Python/executor.c
@@ -62,7 +62,7 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject
PyUnicode_AsUTF8(_PyFrame_GetCode(frame)->co_qualname),
PyUnicode_AsUTF8(_PyFrame_GetCode(frame)->co_filename),
_PyFrame_GetCode(frame)->co_firstlineno,
- 2 * (long)(frame->prev_instr + 1 -
+ 2 * (long)(frame->instr_ptr -
(_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive));
PyThreadState *tstate = _PyThreadState_GET();
@@ -131,6 +131,7 @@ error:
// The caller recovers the frame from tstate->current_frame.
DPRINTF(2, "Error: [Opcode %d, operand %" PRIu64 "]\n", opcode, operand);
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
+ frame->return_offset = 0; // Don't leave this random
_PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(self);
return NULL;
@@ -140,7 +141,7 @@ deoptimize:
// This presumes nothing was popped from the stack (nor pushed).
DPRINTF(2, "DEOPT: [Opcode %d, operand %" PRIu64 "]\n", opcode, operand);
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
- frame->prev_instr--; // Back up to just before destination
+ frame->return_offset = 0; // Dispatch to frame->instr_ptr
_PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(self);
return frame;