summaryrefslogtreecommitdiff
path: root/Python/frame.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-04-07 12:31:01 -0700
committerGitHub <noreply@github.com>2022-04-07 12:31:01 -0700
commitef6a482b0285870c45f39c9b17ed827362b334ae (patch)
treea32a27a4d209b974d9f4d92e7e997dc3ff771409 /Python/frame.c
parent87eec70d97b250f820325b4f1b4f781b443b5180 (diff)
downloadcpython-git-ef6a482b0285870c45f39c9b17ed827362b334ae.tar.gz
bpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208)
Diffstat (limited to 'Python/frame.c')
-rw-r--r--Python/frame.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/frame.c b/Python/frame.c
index 3396ed8d2a..c2da123a2b 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -127,3 +127,10 @@ _PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func)
_PyFrame_InitializeSpecials(new_frame, func, NULL, code->co_nlocalsplus);
return new_frame;
}
+
+int
+_PyInterpreterFrame_GetLine(_PyInterpreterFrame *frame)
+{
+ int addr = _PyInterpreterFrame_LASTI(frame) * sizeof(_Py_CODEUNIT);
+ return PyCode_Addr2Line(frame->f_code, addr);
+}