mirror of
https://github.com/python/cpython.git
synced 2025-09-14 04:37:29 +00:00
[3.10] bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code unit (GH-28711). (GH-28718)
(cherry picked from commit 60b9e040c9
)
This commit is contained in:
parent
f146ca36f8
commit
b5499784ec
3 changed files with 7 additions and 7 deletions
|
@ -46,7 +46,7 @@ PyFrame_GetLineNumber(PyFrameObject *f)
|
|||
return f->f_lineno;
|
||||
}
|
||||
else {
|
||||
return PyCode_Addr2Line(f->f_code, f->f_lasti*2);
|
||||
return PyCode_Addr2Line(f->f_code, f->f_lasti*sizeof(_Py_CODEUNIT));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ frame_getlasti(PyFrameObject *f, void *closure)
|
|||
if (f->f_lasti < 0) {
|
||||
return PyLong_FromLong(-1);
|
||||
}
|
||||
return PyLong_FromLong(f->f_lasti*2);
|
||||
return PyLong_FromLong(f->f_lasti*sizeof(_Py_CODEUNIT));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue