Skip to content

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 <[email protected]>
1 parent d19b5d8 commit e693f84

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
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

+1
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)