summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>2022-07-21 13:49:49 (GMT)
committerGitHub <noreply@github.com>2022-07-21 13:49:49 (GMT)
commita6daaf2a132efbb1965b4502ff8a8cf3b5afed0e (patch)
tree66a13d7bc2f3ad73b3e4b5ceb5e405a1391e4bb1 /Objects
parent834bd5dd766cf212fb20d65d8a046c62a33006d4 (diff)
downloadcpython-a6daaf2a132efbb1965b4502ff8a8cf3b5afed0e.zip
cpython-a6daaf2a132efbb1965b4502ff8a8cf3b5afed0e.tar.gz
cpython-a6daaf2a132efbb1965b4502ff8a8cf3b5afed0e.tar.bz2
Fix PyCode_Addr2Location when addrq < 0 (GH-95091)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/codeobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index d4fa0e3..76e430a 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -971,6 +971,7 @@ PyCode_Addr2Location(PyCodeObject *co, int addrq,
if (addrq < 0) {
*start_line = *end_line = co->co_firstlineno;
*start_column = *end_column = 0;
+ return 1;
}
assert(addrq >= 0 && addrq < _PyCode_NBYTES(co));
PyCodeAddressRange bounds;