summaryrefslogtreecommitdiffstats
path: root/Modules
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 /Modules
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 'Modules')
-rw-r--r--Modules/_tracemalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index fc3d7f5..09d18fb 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -302,7 +302,7 @@ static void
tracemalloc_get_frame(InterpreterFrame *pyframe, frame_t *frame)
{
frame->filename = unknown_filename;
- int lineno = PyCode_Addr2Line(pyframe->f_code, pyframe->f_lasti*2);
+ int lineno = PyCode_Addr2Line(pyframe->f_code, pyframe->f_lasti*sizeof(_Py_CODEUNIT));
if (lineno < 0) {
lineno = 0;
}