summaryrefslogtreecommitdiffstats
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-10-03 18:22:42 (GMT)
committerGitHub <noreply@github.com>2021-10-03 18:22:42 (GMT)
commit60b9e040c9cf40e69f42c0008e564458aa0379e8 (patch)
treec443c7e9b242382b5b19ce0e5209656bdfa88873 /Python/traceback.c
parent4f6e0680d0d8545aa151ccd9de56a39bfe9532a2 (diff)
downloadcpython-60b9e040c9cf40e69f42c0008e564458aa0379e8.zip
cpython-60b9e040c9cf40e69f42c0008e564458aa0379e8.tar.gz
cpython-60b9e040c9cf40e69f42c0008e564458aa0379e8.tar.bz2
bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code unit (GH-28711)
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index 76280a3..06b40bb 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -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);