gh-138661: fix data race in PyCode_Addr2Line (#138664)

This commit is contained in:
Kumar Aditya 2025-09-12 18:04:55 +05:30 committed by GitHub
parent c3fca5d478
commit ea26f6da39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View file

@ -993,8 +993,8 @@ dump_frame(int fd, _PyInterpreterFrame *frame)
} else {
PUTS(fd, "???");
}
int lineno = PyUnstable_InterpreterFrame_GetLine(frame);
int lasti = PyUnstable_InterpreterFrame_GetLasti(frame);
int lineno = _PyCode_Addr2LineNoTstate(code, lasti);
PUTS(fd, ", line ");
if (lineno >= 0) {
_Py_DumpDecimal(fd, (size_t)lineno);