Skip to content

Commit a6daaf2

Browse files
Fix PyCode_Addr2Location when addrq < 0 (GH-95091)
1 parent 834bd5d commit a6daaf2

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
@@ -971,6 +971,7 @@ PyCode_Addr2Location(PyCodeObject *co, int addrq,
971971
if (addrq < 0) {
972972
*start_line = *end_line = co->co_firstlineno;
973973
*start_column = *end_column = 0;
974+
return 1;
974975
}
975976
assert(addrq >= 0 && addrq < _PyCode_NBYTES(co));
976977
PyCodeAddressRange bounds;

0 commit comments

Comments
 (0)