mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-47177: Replace f_lasti
with prev_instr
(GH-32208)
This commit is contained in:
parent
87eec70d97
commit
ef6a482b02
10 changed files with 90 additions and 75 deletions
|
@ -238,8 +238,8 @@ _PyTraceBack_FromFrame(PyObject *tb_next, PyFrameObject *frame)
|
|||
{
|
||||
assert(tb_next == NULL || PyTraceBack_Check(tb_next));
|
||||
assert(frame != NULL);
|
||||
|
||||
return tb_create_raw((PyTracebackObject *)tb_next, frame, frame->f_frame->f_lasti*sizeof(_Py_CODEUNIT),
|
||||
int addr = _PyInterpreterFrame_LASTI(frame->f_frame) * sizeof(_Py_CODEUNIT);
|
||||
return tb_create_raw((PyTracebackObject *)tb_next, frame, addr,
|
||||
PyFrame_GetLineNumber(frame));
|
||||
}
|
||||
|
||||
|
@ -1180,7 +1180,7 @@ dump_frame(int fd, _PyInterpreterFrame *frame)
|
|||
PUTS(fd, "???");
|
||||
}
|
||||
|
||||
int lineno = PyCode_Addr2Line(code, frame->f_lasti*sizeof(_Py_CODEUNIT));
|
||||
int lineno = _PyInterpreterFrame_GetLine(frame);
|
||||
PUTS(fd, ", line ");
|
||||
if (lineno >= 0) {
|
||||
_Py_DumpDecimal(fd, (size_t)lineno);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue