bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)

This commit is contained in:
Victor Stinner 2021-01-19 23:35:27 +01:00 committed by GitHub
parent cad8020cb8
commit 66f77caca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 26 deletions

View file

@ -628,12 +628,12 @@ PyTraceBack_Print(PyObject *v, PyObject *f)
This function is signal safe. */
void
_Py_DumpDecimal(int fd, unsigned long value)
_Py_DumpDecimal(int fd, size_t value)
{
/* maximum number of characters required for output of %lld or %p.
We need at most ceil(log10(256)*SIZEOF_LONG_LONG) digits,
plus 1 for the null byte. 53/22 is an upper bound for log10(256). */
char buffer[1 + (sizeof(unsigned long)*53-1) / 22 + 1];
char buffer[1 + (sizeof(size_t)*53-1) / 22 + 1];
char *ptr, *end;
end = &buffer[Py_ARRAY_LENGTH(buffer) - 1];
@ -767,7 +767,7 @@ dump_frame(int fd, PyFrameObject *frame)
int lineno = PyCode_Addr2Line(code, frame->f_lasti);
PUTS(fd, ", line ");
if (lineno >= 0) {
_Py_DumpDecimal(fd, (unsigned long)lineno);
_Py_DumpDecimal(fd, (size_t)lineno);
}
else {
PUTS(fd, "???");