8000 [3.11] GH-95060: Fix PyCode_Addr2Location when addrq < 0 (GH-95094) · python/cpython@e693f84 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit e693f84

Browse files
[3.11] GH-95060: Fix PyCode_Addr2Location when addrq < 0 (GH-95094)
(cherry picked from commit a6daaf2) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
1 parent d19b5d8 commit e693f84

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Undocumented ``PyCode_Addr2Location`` function now properly returns when
2+
``addrq`` argument is less than zero.

Objects/codeobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@ PyCode_Addr2Location(PyCodeObject *co, int addrq,
969969
if (addrq < 0) {
970970
*start_line = *end_line = co->co_firstlineno;
971971
*start_column = *end_column = 0;
972+
return 1;
972973
}
973974
assert(addrq >= 0 && addrq < _PyCode_NBYTES(co));
974975
PyCodeAddressRange bounds;

0 commit comments

Comments
 (0)
0