mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code unit (GH-28711)
This commit is contained in:
parent
4f6e0680d0
commit
60b9e040c9
5 changed files with 15 additions and 15 deletions
|
@ -240,7 +240,7 @@ _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*2,
|
||||
return tb_create_raw((PyTracebackObject *)tb_next, frame, frame->f_frame->f_lasti*sizeof(_Py_CODEUNIT),
|
||||
PyFrame_GetLineNumber(frame));
|
||||
}
|
||||
|
||||
|
@ -1047,7 +1047,7 @@ dump_frame(int fd, InterpreterFrame *frame)
|
|||
PUTS(fd, "???");
|
||||
}
|
||||
|
||||
int lineno = PyCode_Addr2Line(code, frame->f_lasti*2);
|
||||
int lineno = PyCode_Addr2Line(code, frame->f_lasti*sizeof(_Py_CODEUNIT));
|
||||
PUTS(fd, ", line ");
|
||||
if (lineno >= 0) {
|
||||
_Py_DumpDecimal(fd, (size_t)lineno);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue